Browse Source

fix: Adds aria-label to Table header checkbox (#38336)

* Adds aria-label to Table header checkbox

* Corrects inverted aria label

* Updates some napshots

* Updates transfer snapshots
pull/38355/head
Mike Ellis 2 years ago
committed by GitHub
parent
commit
46a0c60d0c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      components/table/__tests__/__snapshots__/Table.rowSelection.test.tsx.snap
  2. 8
      components/table/__tests__/__snapshots__/demo-extend.test.ts.snap
  3. 8
      components/table/__tests__/__snapshots__/demo.test.ts.snap
  4. 1
      components/table/hooks/useSelection.tsx
  5. 2
      components/transfer/__tests__/__snapshots__/demo-extend.test.ts.snap
  6. 2
      components/transfer/__tests__/__snapshots__/demo.test.ts.snap

6
components/table/__tests__/__snapshots__/Table.rowSelection.test.tsx.snap

@ -53,6 +53,7 @@ exports[`Table.rowSelection fix expand on th left when selection column fixed on
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
value=""
@ -408,6 +409,7 @@ exports[`Table.rowSelection fix selection column on the left 1`] = `
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
value=""
@ -711,6 +713,7 @@ exports[`Table.rowSelection fix selection column on the left when any other colu
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
value=""
@ -1072,6 +1075,7 @@ exports[`Table.rowSelection should support getPopupContainer 1`] = `
class="ant-checkbox"
>
<input
aria-label="Custom selection"
class="ant-checkbox-input"
type="checkbox"
value=""
@ -1431,6 +1435,7 @@ exports[`Table.rowSelection should support getPopupContainer from ConfigProvider
class="ant-checkbox"
>
<input
aria-label="Custom selection"
class="ant-checkbox-input"
type="checkbox"
value=""
@ -1790,6 +1795,7 @@ exports[`Table.rowSelection use column as selection column when key is \`selecti
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
value=""

8
components/table/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -3297,6 +3297,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -19415,6 +19416,7 @@ exports[`renders ./components/table/demo/order-column.md extend context correctl
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -21838,6 +21840,7 @@ exports[`renders ./components/table/demo/row-selection.md extend context correct
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -22189,6 +22192,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md extend c
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -22788,6 +22792,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md extend context
class="ant-checkbox"
>
<input
aria-label="Custom selection"
class="ant-checkbox-input"
type="checkbox"
/>
@ -23707,6 +23712,7 @@ exports[`renders ./components/table/demo/row-selection-custom-debug.md extend co
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -26466,6 +26472,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -26766,6 +26773,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>

8
components/table/__tests__/__snapshots__/demo.test.ts.snap

@ -2767,6 +2767,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -14433,6 +14434,7 @@ exports[`renders ./components/table/demo/order-column.md correctly 1`] = `
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -16384,6 +16386,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -16735,6 +16738,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -17334,6 +17338,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
class="ant-checkbox"
>
<input
aria-label="Custom selection"
class="ant-checkbox-input"
type="checkbox"
/>
@ -17959,6 +17964,7 @@ exports[`renders ./components/table/demo/row-selection-custom-debug.md correctly
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -20602,6 +20608,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -20902,6 +20909,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>

1
components/table/hooks/useSelection.tsx

@ -463,6 +463,7 @@ export default function useSelection<RecordType>(
}
onChange={onSelectAllChange}
disabled={flattedData.length === 0 || allDisabled}
aria-label={customizeSelections ? 'Custom selection' : 'Select all'}
skipGroup
/>
{customizeSelections}

2
components/transfer/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -6550,6 +6550,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -7399,6 +7400,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>

2
components/transfer/__tests__/__snapshots__/demo.test.ts.snap

@ -4044,6 +4044,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
@ -4764,6 +4765,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>

Loading…
Cancel
Save