Revert "fix: preserve mobile section focus"
This reverts commit 7ce1081161.
This commit is contained in:
1 parent
55ee5ef063
commit
d6bb6542c4
1 file changed
+3
-5
@@ -269,7 +269,6 @@ const MobileMoreMenu = ({ showSettings }: { showSettings: boolean }) => {
|
|||||||
const tProfile = useScopedI18n("common.userAvatar.menu");
|
const tProfile = useScopedI18n("common.userAvatar.menu");
|
||||||
const reduceMotion = useReducedMotion();
|
const reduceMotion = useReducedMotion();
|
||||||
const [opened, disclosure] = useDisclosure(false);
|
const [opened, disclosure] = useDisclosure(false);
|
||||||
const moreTriggerRef = useRef<HTMLButtonElement>(null);
|
|
||||||
const pendingSectionAnchorId = useRef<string | null>(null);
|
const pendingSectionAnchorId = useRef<string | null>(null);
|
||||||
const desktopLayout = getDesktopLayout(board);
|
const desktopLayout = getDesktopLayout(board);
|
||||||
const sections = useMemo(
|
const sections = useMemo(
|
||||||
@@ -285,14 +284,14 @@ const MobileMoreMenu = ({ showSettings }: { showSettings: boolean }) => {
|
|||||||
const focusPendingSection = () => {
|
const focusPendingSection = () => {
|
||||||
const anchorId = pendingSectionAnchorId.current;
|
const anchorId = pendingSectionAnchorId.current;
|
||||||
pendingSectionAnchorId.current = null;
|
pendingSectionAnchorId.current = null;
|
||||||
if (anchorId && focusMobileBoardSection({ anchorId, reduceMotion })) return;
|
if (!anchorId) return;
|
||||||
|
|
||||||
moreTriggerRef.current?.focus({ preventScroll: true });
|
focusMobileBoardSection({ anchorId, reduceMotion });
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<HeaderButton ref={moreTriggerRef} onClick={disclosure.open} aria-label={t("board.mobile.more")}>
|
<HeaderButton onClick={disclosure.open} aria-label={t("board.mobile.more")}>
|
||||||
<IconDotsVertical stroke={1.5} />
|
<IconDotsVertical stroke={1.5} />
|
||||||
</HeaderButton>
|
</HeaderButton>
|
||||||
<Drawer
|
<Drawer
|
||||||
@@ -303,7 +302,6 @@ const MobileMoreMenu = ({ showSettings }: { showSettings: boolean }) => {
|
|||||||
size="auto"
|
size="auto"
|
||||||
padding="md"
|
padding="md"
|
||||||
overlayProps={{ backgroundOpacity: 0.45, blur: 2 }}
|
overlayProps={{ backgroundOpacity: 0.45, blur: 2 }}
|
||||||
returnFocus={false}
|
|
||||||
onExitTransitionEnd={focusPendingSection}
|
onExitTransitionEnd={focusPendingSection}
|
||||||
styles={{
|
styles={{
|
||||||
content: {
|
content: {
|
||||||
|
|||||||
Reference in new issue
Block a user