We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f386166 commit 04e263bCopy full SHA for 04e263b
src/components/dropdown/index.js
@@ -439,12 +439,17 @@ export default class Dropdown extends PureComponent {
439
}
440
441
} else {
442
+ let index = selected - dropdownPosition;
443
+
444
+ if (dropdownPosition < 0) {
445
+ index -= visibleItemCount;
446
+ }
447
448
+ index = Math.max(0, index);
449
+ index = Math.min(index, itemCount - visibleItemCount);
450
451
if (~selected) {
- if (dropdownPosition < 0) {
- offset = itemSize * (selected - visibleItemCount - dropdownPosition);
- } else {
- offset = itemSize * (selected - dropdownPosition);
- }
452
+ offset = itemSize * index;
453
454
455
0 commit comments