Skip to content

Commit

Permalink
Merge pull request #3402 from timothypage/master
Browse files Browse the repository at this point in the history
fix MenuList scrolling issue in IE11 with openMenuOnFocus option
  • Loading branch information
gwyneplaine authored Feb 14, 2019
2 parents 51fa3de + 58de3f0 commit c31ef94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ export default class Select extends Component<Props, State> {
blur = this.blurInput;

openMenu(focusOption: 'first' | 'last') {
const { menuOptions, selectValue } = this.state;
const { menuOptions, selectValue, isFocused } = this.state;
const { isMulti } = this.props;
let openAtIndex =
focusOption === 'first' ? 0 : menuOptions.focusable.length - 1;
Expand All @@ -492,7 +492,8 @@ export default class Select extends Component<Props, State> {
}
}

this.scrollToFocusedOptionOnUpdate = true;
// only scroll if the menu isn't already open
this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef);
this.inputIsHiddenAfterUpdate = false;

this.onMenuOpen();
Expand Down

0 comments on commit c31ef94

Please sign in to comment.