about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/compose/components/privacy_dropdown.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-08-21 14:14:28 +0200
committerGitHub <noreply@github.com>2020-08-21 14:14:28 +0200
commitc7cfd4e67aedb38cba3ee452e18bd086e30e2e5d (patch)
tree831a5cf5a202c053e4af69bd1bc3d4f13912dd7c /app/javascript/mastodon/features/compose/components/privacy_dropdown.js
parent9b2648b30adfa57dc12153c7a4e0fd9ac2f187dd (diff)
Fix scrolling issues when closing some dropdown menus (#14606)
Diffstat (limited to 'app/javascript/mastodon/features/compose/components/privacy_dropdown.js')
-rw-r--r--app/javascript/mastodon/features/compose/components/privacy_dropdown.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js
index 96028e042..5223025fb 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 });
   }