mdbootstrap / TW-Elements

𝙃𝙪𝙜𝙚 collection of Tailwind MIT licensed (free) components, sections and templates 😎
https://tw-elements.com
MIT License
12.78k stars 1.62k forks source link

tw-elements does not work inside livewire modals #2092

Open rhmorlans opened 8 months ago

rhmorlans commented 8 months ago

Describe the bug Tw-elements using JS does not work properly inside livewire modals. I was able to install tw-elements in a laravel project. When I use in a full page blade component, tw-elements works well, but I was not able to make it work inside a livewire modal. I think the issue is a JS problem...

juujisai commented 8 months ago

TW Elements, being a Vanilla JS package, might face challenges with frameworks that dynamically update components, such as Livewire. In such cases, component reinitialization could be necessary (although I can't be 100% certain since I've never used Livewire).

Link to the discussion about the topic. I know that it's your topic, but it may be useful to someone else. https://github.com/mdbootstrap/TW-Elements/discussions/1634.

@rhmorlans did try using the wire:ignore directive in Livewire. Maybe it could be helpful to you. https://livewire.laravel.com/docs/wire-ignore.

rhmorlans commented 8 months ago

TW Elements, being a Vanilla JS package, might face challenges with frameworks that dynamically update components, such as Livewire. In such cases, component reinitialization could be necessary (although I can't be 100% certain since I've never used Livewire).

Link to the discussion about the topic. I know that it's your topic, but it may be useful to someone else. #1634.

@rhmorlans did try using the wire:ignore directive in Livewire. Maybe it could be helpful to you. https://livewire.laravel.com/docs/wire-ignore.

Thanks a lot for your comments. I tried to use wire:ignore but it seems not to work in this case...

image

image

This should be the result.

image

I also tried to modify default settings of tw-elements to

image
MaciejZimoch commented 8 months ago

As I just wrote in the similar thread, also Livewire-related: As this is a Livewire issue not a TWE one, our team cannot really speak to Livewire specific issues. As we are an open-source community: I will flag this here and I have signalled the issue on our Discord. Maybe someone there is more Livewire savvy :)

rhmorlans commented 8 months ago

As I just wrote in the similar thread, also Livewire-related: As this is a Livewire issue not a TWE one, our team cannot really speak to Livewire specific issues. As we are an open-source community: I will flag this here and I have signalled the issue on our Discord. Maybe someone there is more Livewire savvy :)

Yes, you are right. Thanks a lot @MaciejZimoch