-
-
Notifications
You must be signed in to change notification settings - Fork 2
[BUG]: Dynamic directive fails to trap keyboard at first #6
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
Comments
Thank you for reporting. Should be fixed with v1.0.18 on npm |
Thanks. I can see the newest version prevents focus outside of dialog, but the outline is missing on links (in my CodeSandbox example) for some reason. It also disappears when I click on one of the links... looks more like a browser issue. What precisely happens is However I can mitigate it by using <dialog ref="dialog" :inert="!visible" v-kbd-trap="visible">
<!-- content -->
</dialog> |
Hmm, it's strange.
If you discover something (or have any idea) please tell me. |
After reading spec I suspect that Chrome is more in-line with the requirements:
The button and inputs behave different than links... maybe because of heuristics mentioned by the spec. Your helper function calling Overall I can live with 2 workarounds ( |
I would agree with them if they were consistent. |
I think you mean |
No, I mean that:
|
Oh... I see. The styles for The generic CSS rule should be a decent way to force some consistency across the browsers, for now. |
You should upgrade to v1.0.19 - a fix not to add |
Describe the bug
I tried to use dynamic directive, but it works partially. First round of tabbing escapes the trap. When I go back inside (e.g. using
[SHIFT]
+[TAB]
), the trap works.Example on CodeSandbox
To Reproduce
Steps to reproduce the behavior:
v-kbd-trap="enabled"
on a rendered elementenabled
totrue
)[TAB]
few times[SHIFT]
+[TAB]
to get back into the dialog[TAB]
few times againExpected behavior
The directive should keep focus inside all the time
Recording

Environment:
Workaround
Additional
<div>
withv-if
... so actually it means you cannot use "dynamic" mode at all.The text was updated successfully, but these errors were encountered: