After clicking the save button select2 is disabled

Hallo,
after clicking the save button select2 is disabled

code my blade :

 <div wire:ignore class="form-group">
     <label class="col-sm-3 control-label">Minat Prodi</label>
               <div class="col-sm-9">
                      <select class="form-control select2{{ $errors-has('kode_program_studi') ? 'is-invalid':'' }}" required>
                                <option value="">Pilih Program Studi</option>
                                @foreach (\App\Program_studi::all() as $prodi)
                                 <option value="{{ $prodi->kode_program_studi }}">{{ $prodi->kode_program_studi }} / {{ $prodi->nama_program_studi }}</option>
                                 @endforeach
                        </select>
                        <p class="text-danger">{{ $errors->first('kode_program_studi') }}</p>
               </div>
      </div>  

    @push('scripts')
        <script>
            $(document).ready(function() {
                $('.select2').select2();
                $('.select2').on('change', function (e) {
                @this.set('kode_program_studi', e.target.value);       });
            });
        </script>
    @endpush

Screen Shot 2020-05-23 at 2.35.58 PM

thank’s

It is the reason for that the select is disabled

I tried it yesterday and it turned out that without wire:ignore select2 would be disabled. With wire:ignore it stays enabled but also it doesn’t update, obiously :smiley: I guess the problem is that the <script> part won’t be evaluated again after updating the component, which makes sense. So maybe one solution would be to fire an event from Livewire that you can listed to in JavaScript and initialize select2 again.

correct i also couldn’t get it to work with select2 for the same problem. it seems to me that with alphinejs there is how to do it. but I didn’t try