Fix page incorrectly scrolling when bringing up dropdown menus
This commit is contained in:
parent
7b7808defe
commit
9b879b6931
2 changed files with 2 additions and 2 deletions
|
@ -46,7 +46,7 @@ class DropdownMenu extends React.PureComponent {
|
|||
document.addEventListener('keydown', this.handleKeyDown, false);
|
||||
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);
|
||||
if (this.focusedItem && this.props.openedViaKeyboard) {
|
||||
this.focusedItem.focus();
|
||||
this.focusedItem.focus({ preventScroll: true });
|
||||
}
|
||||
this.setState({ mounted: true });
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ class PrivacyDropdownMenu extends React.PureComponent {
|
|||
componentDidMount() {
|
||||
document.addEventListener('click', this.handleDocumentClick, false);
|
||||
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);
|
||||
if (this.focusedItem) this.focusedItem.focus();
|
||||
if (this.focusedItem) this.focusedItem.focus({ preventScroll: true });
|
||||
this.setState({ mounted: true });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue