RRUI-018 · RapidRailsUI defect
Disabled checkboxes skew Select All state
The checkbox controller skips disabled items when toggling but includes them when calculating Select All state.
Upstream triage requested. This was found while following the standard RapidRailsUI installation guide in a vanilla Rails 8 application using Importmap and Tailwind CSS v4.
At a glance
| Component | `checkbox_controller.js` |
|---|---|
| Observed | `toggleAll` changes only enabled items, while `updateSelectAllState` compares checked items against every item target. An unchecked disabled item leaves Select All indeterminate even when every selectable item is checked. |
| Expected | Select All should reflect only checkboxes that the user can select: unchecked, checked, or indeterminate among enabled items. |
| Impact | The control communicates an incorrect state and can make a completed selection look incomplete. |
Reproduction
1. Render a checkbox group with two enabled items and one disabled unchecked item.\n2. Select all enabled items.\n3. Observe that the Select All checkbox remains indeterminate instead of checked.
Suggested direction
Filter disabled item targets out before calculating both the total and checked counts.
Consumer workaround
Use a local controller copy that calculates state from `itemTargets.filter((checkbox) => !checkbox.disabled)`.