Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectionPlugin: MultiSelectHeader checkbox should get unchecked if not all table entries are checked #910

Closed
bschmelcher opened this issue Feb 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working version 2.x.x Version 2.x.x issues
Milestone

Comments

@bschmelcher
Copy link

Describe the bug
If the MultiSelectHeader checkbox of the SelectionPlugin is checked, currently it is staying checked even when no table rows are checked after a change.
This is observable using LocalListDataStore.setData (where the table data is refreshed and table rows are re-added unchecked), and also using pagination where the selected rows get unchecked when changing pages.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://dominokit.com/domino-ui/demo/v1/datatable/mix-plugins or https://dominokit.com/domino-ui/demo/v2/datatable/mix-plugins
  2. Click the "Select all" Checkbox in the header
  3. Switch to another page of pagination
  4. See error, no table entries are checked but the header checkbox is still checked.

Expected behavior
Header "Select all" checkbox should not be checked if not all table rows are checked

Screenshots
Before changing page:
image
After changing page:
image

Additional context
If the Header Checkbox would be somehow accessible, it could be unchecked manually but it is directly appended as a HTMLElement in the SelectionPlugin, and controlled via a changeHandler and a datatable-SelectionListener (V1, haven't checked V2 yet).

@vegegoku vegegoku self-assigned this Mar 18, 2024
@vegegoku vegegoku added bug Something isn't working version 2.x.x Version 2.x.x issues labels Mar 18, 2024
@vegegoku vegegoku added this to the 2.0.1 milestone Mar 18, 2024
vegegoku added a commit that referenced this issue Apr 15, 2024
…cked if not all table entries are checked
@howudodat
Copy link

looks like the recent changes to SelectionPlugin created a bug. if multiselect is true, it works fine. if multiselect is false, then SelectionPlugin#updateHeaderCheckBox() crashes on lines 330 and 332 because headerCheckBox is null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working version 2.x.x Version 2.x.x issues
Projects
None yet
Development

No branches or pull requests

3 participants