From 6ea766d93be183c4998cbcab0050d00f02b978d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 16 Aug 2024 17:53:00 +0200 Subject: [PATCH] fix scroll MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/components/dropdown-menu/dropdown-menu.tsx | 2 +- src/init/soapbox-mount.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/dropdown-menu/dropdown-menu.tsx b/src/components/dropdown-menu/dropdown-menu.tsx index 8a2d0da4ea..cc28011feb 100644 --- a/src/components/dropdown-menu/dropdown-menu.tsx +++ b/src/components/dropdown-menu/dropdown-menu.tsx @@ -243,7 +243,7 @@ const DropdownMenu = (props: IDropdownMenu) => { history.push(pathname, { ...(state as any), soapboxDropdownKey: dropdownHistoryKey.current }); unlistenHistory.current = history.listen(({ state }, action) => { - if (!(state as any)?.soapboxModalKey) { + if (!(state as any)?.soapboxDropdownKey) { handleClose(); } else if (action === 'POP') { handleClose(false); diff --git a/src/init/soapbox-mount.tsx b/src/init/soapbox-mount.tsx index ab7b1b6138..61dc3a4b8d 100644 --- a/src/init/soapbox-mount.tsx +++ b/src/init/soapbox-mount.tsx @@ -38,7 +38,8 @@ const SoapboxMount = () => { // @ts-ignore: I don't actually know what these should be, lol const shouldUpdateScroll = (prevRouterProps, { location }) => - !(location.state?.soapboxModalKey && location.state?.soapboxModalKey !== prevRouterProps?.location?.state?.soapboxModalKey); + !(location.state?.soapboxModalKey && location.state?.soapboxModalKey !== prevRouterProps?.location?.state?.soapboxModalKey) + && !(location.state?.soapboxDropdownKey && location.state?.soapboxDropdownKey !== prevRouterProps?.location?.state?.soapboxDropdownKey); return (