-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SideNav and overlay behaviour on click #3666
Comments
React code example reproducing the issue: https://codesandbox.io/s/sidenavissues-jtrzb Result here: https://jtrzb.csb.app/#/
Related issues with keyboard navigation:
|
@nxn-4-wdf hey man, i ran into this problem too. just change your <Header component to look like this:
tadaaaaa |
@nxn-4-wdf yo. i ran into another problem where the sidenav stays there if you resize the browser so i amended the code to look like this. this fixes both the click out issue you describes as well as a broken ghosted sidenav on resize
|
@dryhurst Thanks for your code!
Thanks! |
Hey, I have solved it with a workaround, I have identified that by clicking on the nav items it didn't remove the bx--side-nav--expanded class of the side nav panel.
|
this will trigger when you try to expand a sidenav menu as well.
|
HeaderMenuButton not rendering on Chrome but I can see it when I open the CodeSandBox, any reason for this? |
make sure you have this added. also.. this appears only on low width pages. (max ~1050px) |
Is there a way to display the HeaderMenuButton even if the page width is more than 1050px? And when the HeaderMenuButton is expanded the background is not greyed out. |
^would like to second this question. Basically, is there a way to turn responsiveness off through props or something? It seems odd it forces you to use responsiveness. |
cc @carbon-design-system/design do we have a spec that covers the expand/collapse behavior for the sidenav? also is the expand/collapse behavior only available at smaller screen sizes? |
@here So the current Storybook may have a bug issue with it. But this old issue has the correct specified interaction spec in its and should resolve the current issues with the SideNav in Storybook. |
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
I use the UI shell with a SideNav, and a HashRouter, similar to what's described in the Carbon React tutorial.
On small or medium viewports, when you click on the HeaderMenuButton, the SideNav is expanded, and the rest of the page content is masked by a gray overlay.
Then there are 2 related issues:
In both cases, user expects the SideNav to be closed after a click inside or outside of it, because that's the way most apps behave.
Bug seems browser-independent.
Using Node.js 10.16.2 (LTS). Dependencies and versions from
package.json
:Steps to reproduce the issue
Setup project with the UI Shell like in the Carbon React tutorial:
Additional information
Picture below shows a prototype: clicking on any of the zones pointed to by an arrow should close the side navigation.
The text was updated successfully, but these errors were encountered: