-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
onKeyDown on <Modal/> #1849
Comments
Thank you! Sorry for posting again, but I can't recreate the way it was working on |
It's a hateful workaround, but you can use there following: const id = 'my-modal'
const captureFocus = () => {
const el = document.querySelector(`#${id}`)
el.focus()
}
<Modal id={id} onOpen={captureFocus} trigger={<Button />} /> Also, check #1732 for more details, there is also a codepen that will be helpful. |
Thank you, I'll try this! |
Not sure if this was intended behavior, but I added an
onKeyDown
attribute on the<Modal />
-Component to navigate through pictures shown inside Modal. But since Version 0.65.0 this doesn't work anymore.Steps
Adding an
onKeyDown
attribute to<Modal />
Expected Result
Should fire the
onKeyDown
event.Actual Result
Does not fire the
onKeyDown
event.Version
0.65.0+
Testcase
0.64.8: https://codepen.io/anon/pen/bRQQwV?editors=1111 (Working, outputs the pressed key to the console.)
0.65.0: https://codepen.io/anon/pen/OgaBYe?editors=1111 (Not working, does not output the pressed key to the console.)
The text was updated successfully, but these errors were encountered: