DataTables / SearchPanes

SearchPanes extension for DataTables
https://datatables.net
Other
19 stars 10 forks source link

bug when selecting all filters then unselecting 1 filter on the same pane with cascade on #22

Closed z1ad closed 3 years ago

z1ad commented 3 years ago

hello,

test case: http://live.datatables.net/quzusobu/4/edit

if you select all 4 cities (office) using ctrl + click, and then unselect 1 city, that city will disappear from the list (until you reset or unselect another city)

the behaviour is worse if you select all 4 cities, select 1 item from another pane, and then unselect 1 city - it will hide multiple items on the second pane

this issue seems to be occurring since version 1.2.0 and still seems to be there on the nightly build.

regards

SandyDatatables commented 3 years ago

Hi @z1ad ,

Thanks for pointing this out. Something isn't right there. I've raised an issue internally (DD-1783 for my reference) and will report back here when there is an update.

Thanks, Sandy

SandyDatatables commented 3 years ago

Hi @z1ad ,

I've commited a fix as you will see above.

if you select all 4 cities (office) using ctrl + click, and then unselect 1 city, that city will disappear from the list (until you reset or unselect another city)

I agree with you on this point, I've made our checks for when filtering is present more sophisticated to cope with this.

the behaviour is worse if you select all 4 cities, select 1 item from another pane, and then unselect 1 city - it will hide multiple items on the second pane

I disagree on this point though I'm afraid. In this case the last change that you make is in the office pane, so you would expect all of the others to filter down to reflect the displayed results. In this case though it was removing options that had previously been selected so I have fixed that now.

I've passed this over for testing and will leave the issue open until that has been completed, in case anything else relevant is found.

Thanks, Sandy

z1ad commented 3 years ago

@SandyDatatables - appreciate the quick resolution

regarding point 2, I was just providing another example where it breaks. you are correct, the filter should cascade across all panes.

thanks for your work on this plugin, it is very helpful indeed.