MedicOneSystems / livewire-datatables

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS
https://livewire-datatables.com/
MIT License
1.19k stars 259 forks source link

Bug Report - Issue when i delete column filter #617

Open JoaVitoTavares opened 5 months ago

JoaVitoTavares commented 5 months ago

This issue occurs when i rapidly click to delete the column filter. Recently encountered a bug in my application and traced it to the following file:

mediconesystems/livewire-datatables/src/Http/Livewire/LivewireDatatable.php:1001

The line 1001 is: if (count($this->activeSelectFilters[$column]) < 1) { it belongs to the following function:

public function removeSelectFilter($column, $key = null) { unset($this->activeSelectFilters[$column][$key]); $this->visibleSelected = $this->selected; if (count($this->activeSelectFilters[$column]) < 1) { unset($this->activeSelectFilters[$column]); } $this->setPage(1); $this->setSessionStoredFilters(); } When testing the same functionality on the livewire tables demo i encountered a similar problem in the "weapon names" column. Here's a screenshot for reference:

image

I conducted this test on the Google Chrome and Firefox utilizing a Linux Mint 19.3 system OS.

spekulatius commented 2 months ago

This issue occurs when i rapidly click to delete the column filter. Recently encountered a bug in my application and traced it to the following file:

mediconesystems/livewire-datatables/src/Http/Livewire/LivewireDatatable.php:1001

The line 1001 is: if (count($this->activeSelectFilters[$column]) < 1) { it belongs to the following function:

public function removeSelectFilter($column, $key = null) { unset($this->activeSelectFilters[$column][$key]); $this->visibleSelected = $this->selected; if (count($this->activeSelectFilters[$column]) < 1) { unset($this->activeSelectFilters[$column]); } $this->setPage(1); $this->setSessionStoredFilters(); } When testing the same functionality on the livewire tables demo i encountered a similar problem in the "weapon names" column. Here's a screenshot for reference:

image

I conducted this test on the Google Chrome and Firefox utilizing a Linux Mint 19.3 system OS.

I can confirm this bug. It's happening for our project as well.