Skip to content

Commit

Permalink
[EuiBasicTable][tech debt] Clean up now-unnecessary conditional mobil…
Browse files Browse the repository at this point in the history
…e select all checkbox logic

- Since the mobile header no longer renders or non-mobile views, we don't need this conditional logic anymore wooo
  • Loading branch information
cee-chen committed Jun 6, 2024
1 parent cff77ae commit 8c93edc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ exports[`EuiBasicTable renders (kitchen sink) with pagination, selection, sortin
aria-label="Select all rows"
class="euiCheckbox__input"
data-test-subj="checkboxSelectAll"
id="_selection_column-checkbox_generated-id_desktop"
id="_selection_column-checkbox_generated-id"
title="Select all rows"
type="checkbox"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ exports[`EuiInMemoryTable behavior mobile header 1`] = `
<input
aria-label="Select all rows"
class="euiCheckbox__input"
id="_selection_column-checkbox_generated-id_mobile"
data-test-subj="checkboxSelectAll"
id="_selection_column-checkbox_generated-id"
title="Select all rows"
type="checkbox"
/>
Expand All @@ -19,7 +20,7 @@ exports[`EuiInMemoryTable behavior mobile header 1`] = `
/>
<label
class="euiCheckbox__label"
for="_selection_column-checkbox_generated-id_mobile"
for="_selection_column-checkbox_generated-id"
>
Select all rows
</label>
Expand Down
5 changes: 2 additions & 3 deletions packages/eui/src/components/basic_table/basic_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -711,14 +711,13 @@ export class EuiBasicTable<T extends object = any> extends Component<
>
{([selectAllRows, deselectRows]: string[]) => (
<EuiCheckbox
id={this.selectAllIdGenerator(isMobile ? 'mobile' : 'desktop')}
id={this.selectAllIdGenerator()}
type={isMobile ? undefined : 'inList'}
checked={checked}
indeterminate={indeterminate}
disabled={disabled}
onChange={onChange}
// Only add data-test-subj to one of the checkboxes
data-test-subj={isMobile ? undefined : 'checkboxSelectAll'}
data-test-subj="checkboxSelectAll"
aria-label={checked || indeterminate ? deselectRows : selectAllRows}
title={checked || indeterminate ? deselectRows : selectAllRows}
label={isMobile ? selectAllRows : null}
Expand Down

0 comments on commit 8c93edc

Please sign in to comment.