What seems to be the problem: After every automatic refresh that might occur after an action is triggered or an event is listened my components seems like they lose some of their css properties even if in the actual HTML they are still there
Steps to Reproduce: Just click on any clickable component or change the value of a select
Are you using the latest version of Livewire: yes
Do you have any screenshots or code examples:
Example of one componnt:
First render and refresh render (sorry i can only post 1 image as a new user):
Code: this is the component
<div>
<div class="row page-titles mx-0">
<div class="col-sm-8 p-md-0">
<div class="welcome-text">
<h4>Filtra</h4>
<div class="form-group" style="display: inline-block;">
<label>Anno di riferimento</label>
<select class="form-control" id="annoRif" wire:model="filter.anno" wire:change="filtri" name="anno" style="width:220px;">
<option wire:click="filtri" value="">Tutti</option>
@if (!empty($anni))
@foreach ($anni as $an)
<option wire:key="{{$loop->index}}" value="{{$an['annoRiferimento']}}">{{$an['annoRiferimento']}}</option>
@endforeach
@endif
</select>
</div>
<div class="form-group" style="display: inline-block;">
<label>Imposta</label>
<select class="form-control" id="imposta" wire:model="filter.imposta" wire:change="filtri" name="imposta" style="width:220px;">
<option value="">Tutte</option>
@if(!empty($nomi_imposta))
@foreach ($nomi_imposta as $n)
<option wire:key="{{$loop->index}}" value="{{$n['id']}}">
@if($n['descrizione_sintetica'] != '')
{{ $n['descrizione_sintetica'] }}
@else
{{ $n['descrizione_imposta'] }}
@endif
</option>
@endforeach
@endif
</select>
</div>
<div class="form-group" style="display: inline-block;">
<label>Procedure</label>
<select class="form-control" id="proc" name="procedura" wire:model="filter.procedura" wire:change="filtri" style="width:220px;">
<option wire:key="1" value="">Ignora</option>
<option wire:key="2" value="1">SI</option>
<option wire:key="3" value="0">NO</option>
</select>
</div>
<div class="form-group" style="display: inline-block;">
<label>Inesigibilità</label>
<select class="form-control" id="inesigib" name="inesigibilita" wire:model="filter.inesigibilita" wire:change="filtri" style="width:220px;">
<option wire:key="1" value="">Ignora</option>
<option wire:key="2" value="1">SI</option>
<option wire:key="3" value="0">NO</option>
</select>
</div>
<div class="form-group" style="display: inline-block;">
<label>Cerca Residui</label>
<select class="form-control" id="cerca_residui" name="residui" wire:model="filter.residui" wire:change="filtri" style="width:220px;">
<option wire:key="1" value="%">Ignora</option>
<option wire:key="2" value="0">NO</option>
<option wire:key="3" value="1">SI</option>
</select>
</div>
</div>
</div>
</div>
</div>
this is the controller (the logic is actually working, no problems there)
<?php
namespace App\Http\Livewire;
// Imports
class GestionaleHeaderFilter extends Component
{
protected $paginationTheme = 'bootstrap';
protected $connection = null;
public $first_render = true;
public $filtered = null;
public $nomi_imposta = null;
public $anni_riferimento = null;
public $filter = [
'anno' => '',
'procedura' => '',
'inesigibilita' => '',
'imposta' => '',
'residui' => ''
];
public function mount(Request $request) {
$this->nomi_imposta = // Working query
$this->anni_riferimento = // Working query
}
public function filtri() {
$options = array();
// Filtering logic, this is actually tested and working
}
public function render()
{
return view('livewire.gestionale-header-filter')
->with('nomi_imposta', $this->nomi_imposta)
->with('anni', $this->anni_riferimento);
}
}
Please note that this happens for every component and with the one in the example.
Thank you for any help/suggestion.