]> cat aescling's git repositories - mastodon.git/commitdiff
Fix TL sometimes jumping when closing modals (#14019)
authorThibG <thib@sitedethib.com>
Wed, 10 Jun 2020 11:57:13 +0000 (13:57 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Jun 2020 11:57:13 +0000 (13:57 +0200)
Fixes #14018

app/javascript/mastodon/components/modal_root.js

index fa4e59192119fbc4ad993999fc85bcc85bd5e3ba..6297b5e2938f694d2d9e4b65c947d52f909792e1 100644 (file)
@@ -66,7 +66,7 @@ export default class ModalRoot extends React.PureComponent {
       // immediately selectable, we have to wait for observers to run, as
       // described in https://github.com/WICG/inert#performance-and-gotchas
       Promise.resolve().then(() => {
-        this.activeElement.focus();
+        this.activeElement.focus({ preventScroll: true });
         this.activeElement = null;
       }).catch((error) => {
         console.error(error);