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

Replace Esc key listeners with a CloseWatcher in supported browsers #694

Open
lukewarlow opened this issue Dec 13, 2023 · 0 comments
Open

Comments

@lukewarlow
Copy link

Currently components such as Dialogs can't be closed by platform specific close signals such as the back button / gesture on Android.

Using the new CloseWatcher API [1][2] (where supported) instead of an escape keydown event handlers would address this.

[1] https://html.spec.whatwg.org/multipage/interaction.html#the-closewatcher-interface
[2] https://developer.chrome.com/blog/new-in-chrome-120#close-watcher

https://close-watcher-demo.glitch.me/ - provides a good demo.

This would improve accessibility of primer as it would allow for screen reader users to easily dismiss primer components (close watcher supports the Talkback back gesture for example).

It would also improve consistency with the underlying platform as native html dialogs and popovers have this behaviour built in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant