Skip to content

Commit 39e6cb8

Browse files
committed
[EuiBasicTable][tech debt] Clean up now-unnecessary conditional mobile select all checkbox logic
- Since the mobile header no longer renders or non-mobile views, we don't need this conditional logic anymore wooo
1 parent cfbf8d5 commit 39e6cb8

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

packages/eui/src/components/basic_table/__snapshots__/basic_table.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ exports[`EuiBasicTable renders (kitchen sink) with pagination, selection, sortin
151151
aria-label="Select all rows"
152152
class="euiCheckbox__input"
153153
data-test-subj="checkboxSelectAll"
154-
id="_selection_column-checkbox_generated-id_desktop"
154+
id="_selection_column-checkbox_generated-id"
155155
title="Select all rows"
156156
type="checkbox"
157157
/>

packages/eui/src/components/basic_table/__snapshots__/in_memory_table.test.tsx.snap

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ exports[`EuiInMemoryTable behavior mobile header 1`] = `
1010
<input
1111
aria-label="Select all rows"
1212
class="euiCheckbox__input"
13-
id="_selection_column-checkbox_generated-id_mobile"
13+
data-test-subj="checkboxSelectAll"
14+
id="_selection_column-checkbox_generated-id"
1415
title="Select all rows"
1516
type="checkbox"
1617
/>
@@ -19,7 +20,7 @@ exports[`EuiInMemoryTable behavior mobile header 1`] = `
1920
/>
2021
<label
2122
class="euiCheckbox__label"
22-
for="_selection_column-checkbox_generated-id_mobile"
23+
for="_selection_column-checkbox_generated-id"
2324
>
2425
Select all rows
2526
</label>

packages/eui/src/components/basic_table/basic_table.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,13 +711,12 @@ export class EuiBasicTable<T extends object = any> extends Component<
711711
>
712712
{([selectAllRows, deselectRows]: string[]) => (
713713
<EuiCheckbox
714-
id={this.selectAllIdGenerator(isMobile ? 'mobile' : 'desktop')}
714+
id={this.selectAllIdGenerator()}
715715
checked={checked}
716716
indeterminate={indeterminate}
717717
disabled={disabled}
718718
onChange={onChange}
719-
// Only add data-test-subj to one of the checkboxes
720-
data-test-subj={isMobile ? undefined : 'checkboxSelectAll'}
719+
data-test-subj="checkboxSelectAll"
721720
aria-label={checked || indeterminate ? deselectRows : selectAllRows}
722721
title={checked || indeterminate ? deselectRows : selectAllRows}
723722
label={isMobile ? selectAllRows : null}

0 commit comments

Comments
 (0)