I cant use select2 or selectpicker js libraries with Livewire. Select2 and selectpicker libraries are destroyed after form submit action. If the validation is incorrect after submitting the form, the libraries templates on form elements disappears.
Does anyone have a suggestion why am I having this problem?
I tried it like this, it works, but the selected data in the selection box is not sent after submitting the form. The return value is null. How can I fix this?
@moriarty since you ignore the whole div, it won't really listen to any event that is fired.
My suggestion is to add an event listener to your Livewire so when it is submitted, you retrieve all the values on your select2 component before you send it.
@moriarty you need to use the wire:ignore for your select box to work. But the problem is, since Livewire ignores this, it won't pick up any change events that is why you need to add event listeners on Livewire and retrieve the select2 data from there like I said.