Closed jsznap closed 1 year ago
Had to put JS on app layout and use a livewire event in a rendered lifecycle hook to trigger it. Loading it inside the modal did not trigger it.
I believe <script>
wouldn't work in v2 either. You would have to use Alpine to ensure javascript is executed, for example:
<div x-data x-init="var modalPicker = new pikaday({ field: datepick, format: 'MM/DD/YYYY' })">
</div>
That used to work in v2, 100%.
Using plugins that are globally imported like pikaday/flatpickr/zoomist are not accessible or do not operate inside livewire 3 modals.
Just a basic function like :
<script> var datepick = document.getElementById("showing_date_modal"); // console.log(datepick); var modalPicker = new pikaday({ field: datepick, format: 'MM/DD/YYYY' }) </script>
Works when included in a livewire component but isn't working inside a livewire modal. I already have the include_js disabled and i am including the wire-elements resource in my app.js.