react-hooks-use-modal icon indicating copy to clipboard operation
react-hooks-use-modal copied to clipboard

`close()` useCallback does not work with the button spacebar

Open yamanoku opened this issue 3 years ago • 1 comments

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 avatar Aug 29 '21 08:08 yamanoku

@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.

yuki0410-dev avatar Aug 29 '21 09:08 yuki0410-dev