zaichaopan / react-aria-components-tailwind-starter

Tailwind react aria components starter kits
https://zaichaopan.github.io/react-aria-components-tailwind-starter
MIT License
29 stars 4 forks source link

bug: pressing Esc while AlertDialog is open should close it #1

Closed gregmsanderson closed 4 months ago

gregmsanderson commented 4 months ago

Hello,

This starter kit looks great! I love the look of it.

Small thing: I noticed that pressing Esc does not close the AlertDialog. I believe that it should, since it does when using the official RAC Tailwind storybook. Perhaps you are already aware of that, but in case not:

https://react-spectrum.adobe.com/react-aria-tailwind-starter/index.html?path=/docs/alertdialog--docs

https://zaichaopan.github.io/tailwind-react-aria-components-starter-kits/?path=/docs/alertdialog--docs

gregmsanderson commented 4 months ago

Oh ... never mind. I see what you are doing :)

In the RAC storybook they have their AlertDialog within a Modal. In your example, you have an AlertDialog within an Alert Modal. And that AlertModal component has isKeyboardDismissDisabled = true. Defaulting that to true of course prevents Esc from closing it. So it's working as intended.

All good then.