laravel-livewire-tables: Problem with filter results - Need to refresh
Discussed in https://github.com/rappasoft/laravel-livewire-tables/discussions/374
<div type='discussions-op-text'>Originally posted by lilouch June 23, 2021 Hi,
I have implemented a filter that match a specific label.
->when($this->getFilter('color'), fn ($query, $color) => $query->where('color', $color))
It works the first time. Then, if I select another color, the results are messed up i.e I have not only this color but others colors labels that are shown. But If I refresh the page, the filter works again.
Also, when there are no results, I have actually the message “No items found. Try narrowing your search.”, but I still have some results displayed.
Any ideas why it happens ?
Thank you</div>
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (9 by maintainers)
I had a similar issue and adding a unique wire key to the table body fixed it.
<tbody wire:key="{{ uniqid() }}">