From c7cfd4e67aedb38cba3ee452e18bd086e30e2e5d Mon Sep 17 00:00:00 2001 From: ThibG Date: Fri, 21 Aug 2020 14:14:28 +0200 Subject: Fix scrolling issues when closing some dropdown menus (#14606) --- app/javascript/mastodon/components/dropdown_menu.js | 2 +- .../mastodon/features/compose/components/privacy_dropdown.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/components/dropdown_menu.js b/app/javascript/mastodon/components/dropdown_menu.js index 4734e0f3f..09e3c9df8 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 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 }); } -- cgit From debf6ae31609dcc2fda224b4a6014848cb0e5a27 Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Sun, 23 Aug 2020 07:08:12 +0900 Subject: Fix click range discrepancies in gifv (#14615) --- app/javascript/mastodon/components/gifv.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/components/gifv.js b/app/javascript/mastodon/components/gifv.js index 83cfae49c..b775e5200 100644 --- a/app/javascript/mastodon/components/gifv.js +++ b/app/javascript/mastodon/components/gifv.js @@ -54,8 +54,6 @@ export default class GIFV extends React.PureComponent {