Modal doesn't close, even though property is false #528
Replies: 2 comments 11 replies
-
Hi @estevanmaito, I'm on mobile so could only give it a quick look. You should be doing You'll also need to do For what it's worth, you could use Alpine's Let me know if that helps. |
Beta Was this translation helpful? Give feedback.
-
Solved. It's actually I removed the handler from inside the function and just call |
Beta Was this translation helpful? Give feedback.
-
You can reproduce it here https://codepen.io/estevanmaito/pen/PoPvbBz
If you click 'Open Modal', it opens the modal, and traps the focus inside the modal, so you can TAB indefinitely inside it. If you click outside of it, or in the close button or icon, it closes.
But, if you press ESC, it executes the function
close
,this.show
turns tofalse
, the cleanup is run but the modal is still visible 🤔It's my first time using Alpine, so I may be missing something very obvious 😬
Beta Was this translation helpful? Give feedback.
All reactions