themesberg / flowbite

Open-source UI component library and front-end development framework based on Tailwind CSS
https://flowbite.com
MIT License
7.31k stars 710 forks source link

Fix drawer when using Turbo by adding an extra check when removing drawer backdrop #751

Closed alexandrunastase closed 5 months ago

alexandrunastase commented 6 months ago

This fixes the issue of the drawer breaking when using turbo: image

image

sdhull commented 6 months ago

Appears to duplicate #665 ... but considering there are (from a quick perusal) at least two PRs adding this check, seems likely that one of them should be accepted. Plus looking at it, it just kinda makes sense to me :shrug:

alexandrunastase commented 6 months ago

@sdhull Thanks for chipping in. I didn't notice the other MR, as from what I observed the issue is specific to using the Turbo library for me. If I deactivate it, all seems to be working fine.

Also, although both checks are related to the backdrops, they are in different places, from my side the check is when destroying the backdrop, but on #665 is when creating. The problem I encountered wasn't that an element was duplicated, but rather that there was no element found when destroying the backdrop, when using Turbo.