htmlstreamofficial / preline

Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
https://preline.co
Other
4.81k stars 302 forks source link

Preline Javascript component don't work on livewire modal #436

Closed clecoeur closed 2 weeks ago

clecoeur commented 2 months ago

Summary

JS Component not work on modal

Steps to Reproduce

Hi,

I have a Laravel application with Livewire and a modal created via Livewire, when I try to use a Preline component requiring javascript for example select, the component does not load.

Do you have any idea how to integrate it?

Demo Link

-

Expected Behavior

No response

Actual Behavior

No response

Screenshots

No response

langscot commented 2 months ago

Without a demo link it is pretty hard to diagnose. Are you initializing your select list, either via window.HSStaticMethods.autoInit() or manually via HSSelect's constructor? Can you ensure that the DOM element is on the page at the time of initialization? If you are conditionally rendering stuff in the DOM, you will need to make sure you re-initialize your Preline components too.