From 019be197a76218f855e383f66ef7f015b303dbab Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 11 Oct 2026 10:49:05 -0400 Subject: [PATCH] fix: Tapping a sidebar icon on touch devices opens the document instead of expanding it (#14029) --- app/components/Sidebar/components/SidebarLink.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/components/Sidebar/components/SidebarLink.tsx b/app/components/Sidebar/components/SidebarLink.tsx index d0001d626c..f4e055eb26 100644 --- a/app/components/Sidebar/components/SidebarLink.tsx +++ b/app/components/Sidebar/components/SidebarLink.tsx @@ -269,12 +269,12 @@ const Content = styled.span` min-width: 0; `; +// Stays over the icon while invisible so that a tap on the icon toggles, even +// on touch devices where there is no hover to reveal it first. const HiddenDisclosure = styled(Disclosure)` - position: inherit; inset-inline-start: initial; - display: none; + opacity: 0; margin-inline-start: -2px; - margin-inline-end: 6px; `; const Link = styled(NavLink)<{ @@ -339,12 +339,11 @@ const Link = styled(NavLink)<{ &: ${hover}, &:has([data-state="open"]) { ${HiddenDisclosure} { - display: block; + opacity: 1; } ${HiddenDisclosure} + ${IconWrapper} { visibility: hidden; opacity: 0; - width: 0; } }