-
Notifications
You must be signed in to change notification settings - Fork 166
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
Trap focus within the sidenav on small screens [WD-2277] #4680
Conversation
Demo starting at https://vanilla-framework-4680.demos.haus |
In terms of QA, it's working on the example page but not on the main/docs one. Is that expected? |
I am just checking and I expected it to work there as well - just like any other place where the Could it be that there is something with the |
a7ab5d5
to
4a6c5ec
Compare
I'm not sure if it works as expected… When using |
If you're talking about the docs page, I haven't changed anything yet. I just rebased. |
4a6c5ec
to
b391e34
Compare
I'm not sure if it does: When focus leaves the last link in the navigation it disappears (it is on a toggle button that is below the navigation) instead of going back to top of navigation. Maybe it's casued by the fact that this button on the page is part of |
b391e34
to
55bca68
Compare
@bartaz Sorry for the misunderstanding about which element should the focus be trapped into. It is now trapped inside the |
templates/docs/examples/patterns/side-navigation/_toggle_script.js
Outdated
Show resolved
Hide resolved
@lorumic Looks good (just small variable rename suggestion), could you apply this to Vanilla docs as well? |
55bca68
to
1d281bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done, thanks!
Done
Added an example of how the focus should be controlled within a sidenav drawer to the already existing JS code of the sidenav toggle script.
Fixes #4560
QA
1036px
. The sidenav switches from "pinned" to "drawer" mode.Tab
key multiple times to check that the focus is trapped within the sidenav.Check if PR is ready for release
If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:
Feature 🎁
,Breaking Change 💣
,Bug 🐛
,Documentation 📝
,Maintenance 🔨
.package.json
should be updated relative to the most recent release, following semver convention: