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

fix(ui): selection status not updating after toggleAll in useSelection hook #11218

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

PatrikKozak
Copy link
Contributor

@PatrikKozak PatrikKozak commented Feb 17, 2025

What?

After clicking "Select all" toggleAll(true), manually deselecting an item does not update the overall selection status.

The bulk actions remain visible, and selectAll incorrectly stays as AllAvailable.

How?

Updated setSelection() logic to adjust selectAll when deselecting an item if it was previously set to AllAvailable.

This ensures that the selection state updates correctly without altering the effect logic.

selectAll switches to Some when an item is deselected after selecting all.

Bulk actions now hide correctly if no items are selected.

Fixes #10836

Copy link
Contributor

@paulpopus paulpopus left a comment

Choose a reason for hiding this comment

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

Looks good, just do a manual test with postgres as well since we don't currently have coverage around number ID types

@PatrikKozak PatrikKozak merged commit 5817b81 into main Feb 18, 2025
71 checks passed
@PatrikKozak PatrikKozak deleted the fix/selection-status-toggle branch February 18, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useSelection: selections cannot be updated while selectAll is equal to SelectAllStatus.AllAvailable
3 participants