Pharaonic / livewire-select2

Simple way to handle the Select2 for livewire components.
https://pharaonic.io/packages/livewire/select2
MIT License
37 stars 11 forks source link

Fix:reinitialize select2 on rebuild by livewire #3

Closed Si-HaMaDa closed 2 years ago

Si-HaMaDa commented 2 years ago

There was an issue when I select any value livewire goes and rebuild the html and at this time the select2 disappears and will need to reinitialize again.

MoamenEltouny commented 2 years ago

please can you explain your merge request more? did you use wire:ignore ?

Si-HaMaDa commented 2 years ago

please can you explain your merge request more? did you use wire:ignore ?

Here's my scenario... I have like bills system so the user select the item then the remain data like price, quantity, etc... So there's add button to add new row which will create the select2 after it's first initialize also with any data edit the component rebuild and also the select2 got lost and the field get back to normal and sometimes not even got back to normal but I get white field At first I used wire:ignore and managed all the data manually by pushing it with some events to livewire and at this point I wouldn't need to use this package So when I found this package I wanted to use it to get rid of all the JS code I wrote to handle the case I thought it would be cleaner and easier

MoamenEltouny commented 2 years ago

@Si-HaMaDa Check the latest release and events section in the documentation.