From c813789e06e485f8f3d013b55d1d6ecf9a682a02 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 10 Jun 2020 13:57:13 +0200 Subject: [PATCH] Fix TL sometimes jumping when closing modals (#14019) Fixes #14018 --- app/javascript/mastodon/components/modal_root.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/components/modal_root.js b/app/javascript/mastodon/components/modal_root.js index fa4e591921..6297b5e293 100644 --- a/app/javascript/mastodon/components/modal_root.js +++ b/app/javascript/mastodon/components/modal_root.js @@ -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);