Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

imranshah300's avatar

Livewire Select2 Issue

I have upgraded my Livewire version to Latest and Select2 is disturbed after form submission. Although it was working in Previous version(2) of livewire. Here is my code.

public function hydrate()
    {
        $this->dispatch('select2');
    }  

$(document).ready(function() {
            $('#designation_id').select2({
                placeholder: 'Select a Company',
                allowClear: true
            });
        });
document.addEventListener('DOMContentLoaded', function() {
            Livewire.on('showDesc', function() {
                $('#designation_id').select2();
            });
        });

0 likes
2 replies
Snapey's avatar

what does your html look like and what is going wrong?

Please or to participate in this conversation.