fix: Tapping a sidebar icon on touch devices opens the document instead of expanding it (#14029)

This commit is contained in:
Tom Moor authored and GitHub committed 2026-10-11 10:49:05 -04:00
1 parent 957a91129b
commit 019be197a7
1 file changed
+4 -5
@@ -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;
}
}