Skip to content
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

Modal focus trap multiple key event listeners. #249

Closed
ericfri opened this issue Jan 12, 2024 · 2 comments
Closed

Modal focus trap multiple key event listeners. #249

ericfri opened this issue Jan 12, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ericfri
Copy link

ericfri commented Jan 12, 2024

I have added a modal with a form in it and it seems that if autoinit is run multiple times for whatever reason, the keyboard listener is bound multiple times, so every time you press the tab key to go to the next field, you end up somewhere not expected.
If I set [--tab-accessibility-limited:false], and don't use the focus trap, the tab key works as expected.

Looking through the autoinit code, it seems like a if a check was added to ensure that the keyboard listener is only bound once, it should fix the issue.

@olegpix
Copy link
Collaborator

olegpix commented Jan 15, 2024

I have added a modal with a form in it and it seems that if autoinit is run multiple times for whatever reason, the keyboard listener is bound multiple times, so every time you press the tab key to go to the next field, you end up somewhere not expected. If I set [--tab-accessibility-limited:false], and don't use the focus trap, the tab key works as expected.

Looking through the autoinit code, it seems like a if a check was added to ensure that the keyboard listener is only bound once, it should fix the issue.

Thanks for your comment. We will check this and improve it in the next version.

@jahaganiev jahaganiev added the bug Something isn't working label Feb 28, 2024
@jahaganiev
Copy link
Member

Hey @ericfri - thanks for reporting the issue. We've just pushed the fixes in the v2.1.0 update. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants