Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AbdelrahmanFathy's avatar

alpine.js modal window

I have a problem using alpine.js, modal pop window works good, however at the moment when i refresh the page the modal window appears for just a very small amount of time and then disappeared, I tried to use x-cloak but nothing changes, how to avoid this behaviour ?

0 likes
1 reply
MaverickChan's avatar
Level 47

this is a common trap you will fall in to

add

x-cloak

on your modal root div

in css file add

[x-cloak] {
	display: none !important;
}
2 likes

Please or to participate in this conversation.