-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modal backdrop no longer shows in 2.3.0 #806
Comments
Hey @reubenfirmin, Please update to Tailwind CSS v3.0+. The modal backdrop is still there, but the gradient classes are now changed from the deprecated ones to the new ones: Cheers, |
@zoltanszogyenyi I do see the modal-backdrop div in your samples, but it's no longer appearing in mine. I.e. there's literally no modal-backdrop element present. Here's my body, vs yours. (I was on tailwind 3.3.5, upgraded to 3.4.0 now but no diff) |
Can you double-check the installation? Try clearing the cache. If it doesn't work, can you send the code over some environment so that I can reproduce it? Thanks! |
@zoltanszogyenyi OK - did a clean build, flushed my cache, and also tried another browser. You'll have to squint a bit, since this is kotlin, but hopefully interpretable:
... and then
|
@zoltanszogyenyi Hey, since this is closed, did you lose track of it? Still an issue. |
For some reason, I've got the same issue
edit: but in my case, I do have the backdrop element its just 0x0 and not visible |
Hey everyone, Just released Is this still happening to you alll? If it does, feel free to re-open the issue. Cheers, |
Still happens to me, no backdrop at all. FIX: I had some wrong classes on my tag. |
Hi @zoltanszogyenyi It still happens for me. No modal-backdrop element, same as OP. Rendering with turbo stream. Tried with CDN tags and code from example as follows. All console logs are firing. Thanks
|
I had the same problem, what I had to do was to set the BTW I'm using the tailwindcss-rails gem. |
Hey! Any update with this issue? |
The issue seems to be with Tailwind not recognising that the classes are used and shaking them out of the build. I couldn't get the backdrop to render even on the latest version of Flowbite, but adding the classes used by the overlay to the safelist in the Tailwind config fixes the issue. {
safelist: ['fixed', 'bg-gray-900/50', 'dark:bg-gray-900/80', 'inset-0', 'z-30'],
} Obviously will break again if these classes change, but solves the problem for now. |
Guys, found and solved the issue. Tailwind does not add a component in css if it is not in the static files. The model adds class dynamically to the page and the css is not built because of it. So just open the inspector copy the backdrop classes paste it in a hidden div and it will auto build and work. Hope it works, worked for me! |
@zoltanszogyenyi do something about it |
@joshiabir you're wrong a bit. I've researched this issue and the problem is related to |
I actually used the safeList method and it seems to work for me! Though if the classes are changed in future might not work again! { Just by putting the above in my tailwind.config.js the modal overlay became visible! |
Describe the bug
I upgrades from 2.0.0 to 2.3.0. The opaque backdrop div is no longer rendered with modals; previously it was inserted as the last child in the body (although there was a bug where several could be added).
To Reproduce
I've tried both static and dynamic modals. Static certainly adds a backdrop of some kind in that background elements are not clickable. However, the opaque layer is not shown.
I tried setting backdropClasses as an attribute, but that doesn't appear to work.
The text was updated successfully, but these errors were encountered: