You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says: when creating a drawer component with backdrop initially set to false, but later set to true through bindings, the backdrop will never display even when true. I suspect this is due to the way that the backdrop classes are initialized, as that only checks for backdrop to be true during the initialization of the component (see: this line)
Doing this the other way around works (ie. initializing to true and later changing to false), but can create unintended behaviors. An example of that can be seen with an app that keeps the drawer open on larger screens, where refreshing the page will cause the backdrop to show before being set to false and becoming hidden
This doesn't display the other backdrop issue I mentioned above (with drawers that are always open), but it does showcase the different behaviors between the two initialization values. Should work out of the box and has buttons to activate each type of drawer and toggle their backdrop props
Thinking about it, I'm not entirely sure why the line I referenced above is written the way it is. The only time the backdropDivClass is used is when the backdrop is explicitly desired. I'm assuming this might be a holdover from a previous version where the backdrop was used as the outside click wrapper every time, but that doesn't seem to be the case anymore. Would it be safe to get rid of the extra class checks?
This should work fine and be safe to use from what I can tell:
Describe the bug
(Sorry for the long title haha)
As the title says: when creating a drawer component with
backdrop
initially set tofalse
, but later set totrue
through bindings, the backdrop will never display even whentrue
. I suspect this is due to the way that the backdrop classes are initialized, as that only checks forbackdrop
to betrue
during the initialization of the component (see: this line)Doing this the other way around works (ie. initializing to
true
and later changing tofalse
), but can create unintended behaviors. An example of that can be seen with an app that keeps the drawer open on larger screens, where refreshing the page will cause the backdrop to show before being set tofalse
and becoming hiddenReproduction
Repl: https://replit.com/@GreyHimmel/Drawer-Backdrop-Bug?v=1
This doesn't display the other backdrop issue I mentioned above (with drawers that are always open), but it does showcase the different behaviors between the two initialization values. Should work out of the box and has buttons to activate each type of drawer and toggle their backdrop props
Flowbite version and System Info
The text was updated successfully, but these errors were encountered: