Skip to content

Conversation

@renardudezert
Copy link
Contributor

If the search or filter is active, we must display the count of checked rows only for "visible" items (results of search or filtered results). Therefore, the toggleSelectAll() method must also check or uncheck all "visible" items when the search or filters are active.
See the gif below in order to view the correct behavior (what this PR brings)
bugfix-checkboxes-beahavior-livewire-datatables

- If the search or filter is active, we must display the count of checked rows only for "visible" items (results of search or filtered results). Therefore, the toggleSelectAll() method must also check or uncheck all "visible" items when the search or filters are active.
{
if (count($this->selected) === $this->getQuery()->getCountForPagination()) {
$this->selected = [];
$visible_chekboxes = $this->getQuery()->get()->pluck('checkbox_attribute')->toArray();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: please call this variable $visible_checkboxes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I just corrected it. You've a good eagle eye 😄

@thyseus
Copy link
Collaborator

thyseus commented Nov 17, 2022

@renardudezert thanks a lot for your work, will merge once you fixed that minor typo !

@renardudezert
Copy link
Contributor Author

You're welcome. It is a good project, the contributions are deserved.

@thyseus thyseus merged commit f140158 into MedicOneSystems:master Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants