[Question]: SideNav not closing when clicking links #13911
Labels
status: needs reproduction
Issues lacking a code reproduction
status: needs triage 🕵️♀️
status: waiting for author's response 💬
type: question ❓
Question for Carbon
Package
@carbon/react
Browser
Chrome
Package version
@carbon/react: 1.19.0
React version
18.2.0
Description
As pointed out in #3666 the sideNav menu is not collapsing when clicking a link element. The issue to close the menu by clicking anywhere on the overlay was solved in #8296 but can't find any way to achieve the same behaviour as in the https://carbondesignsystem.com/ and automatically close the side menu. Has this issue been solved?
const MainHeader = () => { return ( <HeaderContainer render={({ isSideNavExpanded, onClickSideNavExpand }) => ( <Header aria-label="Header navigation"> <SkipToContent /> <HeaderMenuButton aria-label={isSideNavExpanded ? "Close menu" : "Open menu"} onClick={onClickSideNavExpand} isActive={isSideNavExpanded} /> ... <SideNav aria-label="Side navigation" expanded={isSideNavExpanded} isPersistent={false} onOverlayClick={onClickSideNavExpand} > <SideNavItems> <HeaderSideNavItems> <HeaderMenuItem element={NavLink} to={
/link1}>Link1
...`
Code of Conduct
The text was updated successfully, but these errors were encountered: