Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
**Bug fixes**

- Fixed tick and level alignment in `Eui[Dual]Range` ([#5181](https://github.com/elastic/eui/pull/5181))
- Fixed duplicate IDs on mobile/desktop select all checkboxes in `EuiBasicTable` ([#5237](https://github.com/elastic/eui/pull/5237))

**Breaking changes**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ exports[`EuiBasicTable with initial selection 1`] = `
checked={false}
compressed={false}
disabled={false}
id="_selection_column-checkbox_generated-id"
id="_selection_column-checkbox_generated-id_mobile"
indeterminate={false}
label="Select all rows"
onChange={[Function]}
Expand All @@ -1476,7 +1476,7 @@ exports[`EuiBasicTable with initial selection 1`] = `
checked={false}
className="euiCheckbox__input"
disabled={false}
id="_selection_column-checkbox_generated-id"
id="_selection_column-checkbox_generated-id_mobile"
onChange={[Function]}
type="checkbox"
/>
Expand All @@ -1485,7 +1485,7 @@ exports[`EuiBasicTable with initial selection 1`] = `
/>
<label
className="euiCheckbox__label"
htmlFor="_selection_column-checkbox_generated-id"
htmlFor="_selection_column-checkbox_generated-id_mobile"
>
Select all rows
</label>
Expand Down Expand Up @@ -1552,7 +1552,7 @@ exports[`EuiBasicTable with initial selection 1`] = `
compressed={false}
data-test-subj="checkboxSelectAll"
disabled={false}
id="_selection_column-checkbox_generated-id"
id="_selection_column-checkbox_generated-id_desktop"
indeterminate={false}
label={null}
onChange={[Function]}
Expand All @@ -1567,7 +1567,7 @@ exports[`EuiBasicTable with initial selection 1`] = `
className="euiCheckbox__input"
data-test-subj="checkboxSelectAll"
disabled={false}
id="_selection_column-checkbox_generated-id"
id="_selection_column-checkbox_generated-id_desktop"
onChange={[Function]}
type="checkbox"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ exports[`EuiInMemoryTable with initial selection 1`] = `
checked={false}
compressed={false}
disabled={false}
id="_selection_column-checkbox_generated-id"
id="_selection_column-checkbox_generated-id_mobile"
indeterminate={false}
label="Select all rows"
onChange={[Function]}
Expand All @@ -936,7 +936,7 @@ exports[`EuiInMemoryTable with initial selection 1`] = `
checked={false}
className="euiCheckbox__input"
disabled={false}
id="_selection_column-checkbox_generated-id"
id="_selection_column-checkbox_generated-id_mobile"
onChange={[Function]}
type="checkbox"
/>
Expand All @@ -945,7 +945,7 @@ exports[`EuiInMemoryTable with initial selection 1`] = `
/>
<label
className="euiCheckbox__label"
htmlFor="_selection_column-checkbox_generated-id"
htmlFor="_selection_column-checkbox_generated-id_mobile"
>
Select all rows
</label>
Expand Down Expand Up @@ -1012,7 +1012,7 @@ exports[`EuiInMemoryTable with initial selection 1`] = `
compressed={false}
data-test-subj="checkboxSelectAll"
disabled={false}
id="_selection_column-checkbox_generated-id"
id="_selection_column-checkbox_generated-id_desktop"
indeterminate={false}
label={null}
onChange={[Function]}
Expand All @@ -1027,7 +1027,7 @@ exports[`EuiInMemoryTable with initial selection 1`] = `
className="euiCheckbox__input"
data-test-subj="checkboxSelectAll"
disabled={false}
id="_selection_column-checkbox_generated-id"
id="_selection_column-checkbox_generated-id_desktop"
onChange={[Function]}
type="checkbox"
/>
Expand Down
5 changes: 3 additions & 2 deletions src/components/basic_table/basic_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ export class EuiBasicTable<T = any> extends Component<
}

tableId = htmlIdGenerator('__table')();
selectAllCheckboxId = htmlIdGenerator('_selection_column-checkbox')();

render() {
const {
Expand Down Expand Up @@ -733,6 +732,8 @@ export class EuiBasicTable<T = any> extends Component<
);
}

selectAllIdGenerator = htmlIdGenerator('_selection_column-checkbox');

renderSelectAll = (isMobile: boolean) => {
const { items, selection } = this.props;

Expand Down Expand Up @@ -763,7 +764,7 @@ export class EuiBasicTable<T = any> extends Component<
<EuiI18n token="euiBasicTable.selectAllRows" default="Select all rows">
{(selectAllRows: string) => (
<EuiCheckbox
id={this.selectAllCheckboxId}
id={this.selectAllIdGenerator(isMobile ? 'mobile' : 'desktop')}
type={isMobile ? undefined : 'inList'}
checked={checked}
disabled={disabled}
Expand Down