rappasoft / laravel-livewire-tables

A dynamic table component for Laravel Livewire
https://rappasoft.com/docs/laravel-livewire-tables/v2/introduction
MIT License
1.7k stars 319 forks source link

[Bug]: Loss of Selections After Search #1702

Open gbaltazar opened 2 months ago

gbaltazar commented 2 months ago

What happened?

Error description: I'm making a multiple selection of items to later perform a Bulk operation with them. I select a first item, then perform a search to select the second one, but the previous selection I had made is cleared.

How to reproduce the bug

I first try searching for the items I want to select, choose one of them, then upon searching to select another, the previous selection is erased. Is it possible to maintain the selection I had made after performing a search in the component?

Package Version

2.15

PHP Version

8.1.x

Laravel Version

10.0

Alpine Version

3.13.9

Theme

Bootstrap 4.x

Notes

No response

Error Message

No response

ivanmar01 commented 1 month ago

I can confirm that bug exists also in latest v3 version.

lrljoe commented 3 weeks ago

@gbaltazar @ivanmar01 - To be honest, it's more intentional than being a bug.

Having something "selected" via the Bulk Action checkboxes, but not visible seems odd to my mind.

E.g. you select the user "Bob" (who lives in "France") after searching for users "Bo", and filtering on Country of Residence.

Then you change the filter, for users who live in "Japan", and search for "Rich" in the name. Having "Bob" still selected, despite not being visible (and thus not deselectable) seems like not great UX.

If there's something I'm missing, then we can look at adding in a config option to enable/disable a different behaviour, but would need to know how widespread the desire is for it so that I can prioritise it.

lrljoe commented 3 weeks ago

Quick update, I've added in some toggles, but it'll be at least a week (ish) for it to make it into v3, as I need to write tests & docs for it.

ivanmar01 commented 2 weeks ago

Thanks for reply. My users have long list of equipment and they are searching it by serial number. After selecting it, selection will bi added to final document. That is my scenario and it will be much easier to remember selected items. All the best!