What is the issue?
PatternFly's Table (and DataView Table) components do not support indeterminate checkbox state for the select-all header checkbox, despite this being recommended in the PatternFly bulk selection design guidelines.
Expected behavior:
The select-all checkbox in the table header should support three states:
-
Unchecked - no items selected
-
Indeterminate (dash/minus icon) - some items selected
-
Checked - all items selected
Current behavior:
The ThSelectType interface only supports isSelected: boolean, which means the checkbox can only be checked or unchecked. When some (but not all) items are selected, the checkbox appears unchecked, which doesn't properly reflect the selection state to users.
Steps to reproduce
- Create a table with selectable rows using the
select prop on Th
- Select some (but not all) rows
- Observe that the header checkbox remains unchecked, even though some items are selected
Code example
// Current interface (v6.4.2)
export interface ThSelectType {
onSelect?: OnSelect;
isSelected: boolean; // Only supports true/false, no indeterminate
isHeaderSelectDisabled?: boolean;
isDisabled?: boolean;
props?: any;
}
Proposed solution
Add support for indeterminate state to ThSelectType:
export interface ThSelectType {
onSelect?: OnSelect;
isSelected: boolean;
isIndeterminate?: boolean; // NEW: Support for partial selection state
isHeaderSelectDisabled?: boolean;
isDisabled?: boolean;
props?: any;
}
The implementation would need to:
- Update the
ThSelectType interface to include isIndeterminate?: boolean
- Update the
selectable decorator to pass indeterminate state to the checkbox
- Update
SelectColumn to set the checkbox's indeterminate property via ref
Related issues
Why this is still needed
While BulkSelect in the toolbar is the recommended pattern, there are valid use cases for table-only selection:
- Tables without toolbars
- Compact UIs where toolbar space is limited
- Consistency with PatternFly design guidelines that show indeterminate state for table headers
Product and version
Type
Enhancement
Jira Issue: PF-4099
What is the issue?
PatternFly's Table (and DataView Table) components do not support indeterminate checkbox state for the select-all header checkbox, despite this being recommended in the PatternFly bulk selection design guidelines.
Expected behavior:
The select-all checkbox in the table header should support three states:
Unchecked - no items selected
Indeterminate (dash/minus icon) - some items selected
Checked - all items selected
Current behavior:
The
ThSelectTypeinterface only supportsisSelected: boolean, which means the checkbox can only be checked or unchecked. When some (but not all) items are selected, the checkbox appears unchecked, which doesn't properly reflect the selection state to users.Steps to reproduce
selectprop onThCode example
Proposed solution
Add support for indeterminate state to
ThSelectType:The implementation would need to:
ThSelectTypeinterface to includeisIndeterminate?: booleanselectabledecorator to pass indeterminate state to the checkboxSelectColumnto set the checkbox'sindeterminateproperty via refRelated issues
Add indeterminate checkbox to table header #3648 - Original request (closed as wontfix due to BulkSelect recommendation)
improvement(Table): implement indeterminate checkbox state #3909 - PR implementing this feature (closed)
Why this is still needed
While BulkSelect in the toolbar is the recommended pattern, there are valid use cases for table-only selection:
Product and version
@patternfly/react-table: 6.4.2
User project: OpenShift Console (using PatternFly DataView)
Type
Enhancement
Jira Issue: PF-4099