You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working with the Listbox component and I noticed a buggy behavior with the "Toggle All" checkbox when a filter is applied.
Currently, if I check the "Toggle All" checkbox with a filter active, it correctly selects the visible options, but unfortunately it clears the selection of any previously selected hidden options. Conversely, if I uncheck "Toggle All", it clears the selection completely by assigning an empty array [], meaning all hidden options lose their selection too.
Here is the snippet causing this in the onToggleAll default logic:
Checking "Toggle All" should add the visible options to the existing selection (modelValue), keeping the hidden selected ones intact.
Unchecking "Toggle All" should remove only the visible options from the existing selection (modelValue), rather than clearing everything.
Additionally, I think adding an indeterminate state to the "Toggle All" checkbox would be a great UX addition for when only some of the items are selected.
Finally, just a quick question about the API: am I correct in understanding that providing the selectAll input bypasses this default logic entirely and forces the developer to handle the toggle state manually? See the code
And this would be the desired behavior, with my changes and since the user doesnt fill the selectAll input, works fine since the allSelect() already aims to visible ones that are selected.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I've been working with the Listbox component and I noticed a buggy behavior with the "Toggle All" checkbox when a filter is applied.
Currently, if I check the "Toggle All" checkbox with a filter active, it correctly selects the visible options, but unfortunately it clears the selection of any previously selected hidden options. Conversely, if I uncheck "Toggle All", it clears the selection completely by assigning an empty array [], meaning all hidden options lose their selection too.
Here is the snippet causing this in the
onToggleAlldefault logic:I believe the expected behavior should be:
Checking "Toggle All" should add the visible options to the existing selection (modelValue), keeping the hidden selected ones intact.
Unchecking "Toggle All" should remove only the visible options from the existing selection (modelValue), rather than clearing everything.
Additionally, I think adding an indeterminate state to the "Toggle All" checkbox would be a great UX addition for when only some of the items are selected.
Finally, just a quick question about the API: am I correct in understanding that providing the selectAll input bypasses this default logic entirely and forces the developer to handle the toggle state manually? See the code
And this would be the desired behavior, with my changes and since the user doesnt fill the selectAll input, works fine since the allSelect() already aims to visible ones that are selected.
20260429-1705-52.1602576.mp4
Beta Was this translation helpful? Give feedback.
All reactions