SideNavigation collapse again after Router action clicked #1093
-
Viewport is narrow, user opens the side nav via the hamburger menu. User clicks on a "Route" link which takes the user to the proper page. The problem is, the side nav remains open. I'm new to Cloudscape and can't figure this out. Is there a solution to this? How can I programmatically or otherwise get the side-nav to return to it's default "collapsed" state after the user takes action? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello Tony, If you want to control the state of the navigation, tools, or split panels, you need to explicitly set the properties and the corresponding event listeners. For the navigation panel, set the For your case, you could try the example below: const [navigationOpen, setNavigationOpen] = useState(true);
<AppLayout
...
navigationOpen={navigationOpen}
onNavigationChange={() => setNavigationOpen(false)}
...
/> Let me know if that helped. Thank you! |
Beta Was this translation helpful? Give feedback.
Thank you, sir. You pointed me in the right direction. I'm brand new to Reactjs and brand new to Cloudscape. But, I like it so far. The way I solved it is with:
and in the Navigation component, I have: