diff --git a/app/javascript/mastodon/components/dropdown_menu.js b/app/javascript/mastodon/components/dropdown_menu.js index 4734e0f3fc..09e3c9df85 100644 --- a/app/javascript/mastodon/components/dropdown_menu.js +++ b/app/javascript/mastodon/components/dropdown_menu.js @@ -205,7 +205,7 @@ export default class Dropdown extends React.PureComponent { handleClose = () => { if (this.activeElement) { - this.activeElement.focus(); + this.activeElement.focus({ preventScroll: true }); this.activeElement = null; } this.props.onClose(this.state.id); diff --git a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js index 96028e0421..5223025fb5 100644 --- a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js +++ b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js @@ -179,7 +179,7 @@ class PrivacyDropdown extends React.PureComponent { } else { const { top } = target.getBoundingClientRect(); if (this.state.open && this.activeElement) { - this.activeElement.focus(); + this.activeElement.focus({ preventScroll: true }); } this.setState({ placement: top * 2 < innerHeight ? 'bottom' : 'top' }); this.setState({ open: !this.state.open }); @@ -220,7 +220,7 @@ class PrivacyDropdown extends React.PureComponent { handleClose = () => { if (this.state.open && this.activeElement) { - this.activeElement.focus(); + this.activeElement.focus({ preventScroll: true }); } this.setState({ open: false }); }