Replace Esc key listeners with a CloseWatcher in supported browsers #2881
lukewarlow
started this conversation in
Ideas
Replies: 1 comment
-
This is a great new API and agree HealessUI should use it. Until then I've rolled up my own useCloseWatcher hook to trigger my onClose callback. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Where it's supported HeadlessUI should use the new CloseWatcher API [1][2] instead of just an escap
This will allow elements such as dialogs and popovers to be closed by the Android back gesture / button (along with potential other close signals other than just escape on desktop)
Additional context
[1] https://html.spec.whatwg.org/multipage/interaction.html#the-closewatcher-interface
[2] https://developer.chrome.com/blog/new-in-chrome-120#close-watcher
Beta Was this translation helpful? Give feedback.
All reactions