I have a filter form where all of the fields are wire:model.defer with the Filter button triggering a search action. I want to have some dynamic action though when I select a city from a select field to load all the suburbs from that city in another select field. I managed to to this using AlpineJS:
<div x-data>
<label>City</label>
<select wire:model.defer="cityId" class="form-row" id="cities" @change="$wire.loadSuburbs($event.target.value)">
@foreach ($cities as $index => $city)
<option value="{{ $city['id'] }}">{{ $city['name'] }}</option>
@endforeach
</select>
</div>
But the issue is, after the suburbs dropdown is updated the component is rerendered and the search is executed again with the new city id. I want only my suburbs dropdown to get filled in after the component is rerendered and search executed only if I explicitly hit the FIlter button.
How is that possible?