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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent tabbing into closed navigation #3114
Conversation
When the navigation is closed, add "inert" attribute to prevent tabbing into the sidebar. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
fc30204
to
e94868a
Compare
according to https://stackoverflow.com/a/64598898 just setting the attribute to null should make Vue remove it |
would be good to do some tests with an app that has the sidebar sadly the style guide cannot test the app navigation |
does anyone has a working npm link setup to quickly test this ? |
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.
The change seems ok, Vue will remove this prop.
But I did not test it properly.
Maybe a full example of this component will help in future changes.
Well sounds like we can fix most of the browsers now and the last one will catch up eventually. |
Not really, the browser versions are all very new. Chrome 102 is just from last May. |
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.
See comments
we could look into polyfills for inert I don't think we should invest time trying to hack this around on our own, unless quick, easy and reliable in caniuse it said Firefox 106 supports it now: https://caniuse.com/?search=inert |
Scheduled to be released on 2022-10-18 馃槙 What about just |
tabindex="-1" on the container doesn't fix sub-items as far as I remember. |
idea: would it be possible to unmount the navigation when it's closed after a small delay ? then mount it again when opened ? might cause delays though when mounting again while the user is swiping |
Would be a good idea, debounce show/hide could be worth it |
Currently 88% of global users are supported, the remaining missing browsers from our browserslist config are currently Safari 15.4 and Firefox ESR. I think this approach:
is now good enough for version 8 / NC28 (meaning I think this is fine for current master). |
This seems to break opening the sidebar when it is closed, see #4433 |
I think we need to move the button outside the navigation element |
When the navigation is closed, add "inert" attribute to prevent tabbing
into the sidebar.
inert="false"
does NOT disable inert, need to remove the attribute completely 馃槖Note: I didn't test this but tied the attribute to the
open
value. I verified in the Talk app that theopen
attribute is properly updated when swiping, resizing the window, etc. So settinginert
under the same conditions should work.