Closed WozniakMac closed 5 months ago
Hey @WozniakMac,
Thanks for the PR! Couple of problems from my side:
data-modal-toggle
attribute?instances.ts
as possibleCheers, Zoltan
@zoltanszogyenyi Thanks for review!
data-drawer-toggle
stays but will work exactly this same as data-drawer-show
and data-drawer-hide
. It was working also without data-modal-target
what was inconsistent. I did it just to simplify things. From now all modals will need to have data-modal-target
because it will be tag that initialise modal.initModals
run. If you run initModals
again it will it will create modals and add event listeners only to new html tags that were added to the page. If you have better ideas how to make sure we don't create modal objects and event listeners on every run I'll be happy to change it. For event listeners we always check if it exists in Instance Manager. That was the issue because Old and New modals will be there.Basically I'm trying to solve 3 things here:
initModals
multiple times.initModals
again.turbo:load
because it swaps the whole body with new one.I can revert changes to data-drawer-toggle
if you want to maintain backwards compatibility with 1.6
Fixes issues: https://github.com/themesberg/flowbite/issues/697 https://github.com/themesberg/flowbite/issues/698
BRAKING CHANGES:
data-modal-toggle
will not work withoutdata-modal-target
anymore.