react-hooks-use-modal
react-hooks-use-modal copied to clipboard
`close()` useCallback does not work with the button spacebar
What's happen ?
The <button>
element can be operated in the same way with the space key as well as the enter key.
But, the <button>
element set in the useCallback close()
does not respond to the space key.
Demo Video
Enter Key
https://user-images.githubusercontent.com/1996642/131243825-6c677d94-246d-4056-8e05-15f08b78748c.mov
Spacebar Key
https://user-images.githubusercontent.com/1996642/131243835-970eb0cb-a784-49b2-bfa1-32098670eb5e.mov
@yamanoku Maybe disable-scroll is the cause. (source)
When I open a modal and then give Hidden CSS Style to the modal, the spacebar doesn't respond to the button.