Skip to content

Commit

Permalink
fix: Adds aria-label to Table header checkbox (ant-design#38336)
Browse files Browse the repository at this point in the history
* Adds aria-label to Table header checkbox

* Corrects inverted aria label

* Updates some napshots

* Updates transfer snapshots
  • Loading branch information
mellis481 authored Nov 3, 2022
1 parent b36ddac commit 46a0c60
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down Expand Up @@ -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=""
Expand Down Expand Up @@ -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=""
Expand Down Expand Up @@ -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=""
Expand Down Expand Up @@ -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=""
Expand Down Expand Up @@ -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=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3297,6 +3297,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
Expand Down Expand Up @@ -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"
/>
Expand Down Expand Up @@ -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"
/>
Expand Down Expand Up @@ -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"
/>
Expand Down Expand Up @@ -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"
/>
Expand Down Expand Up @@ -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"
/>
Expand Down Expand Up @@ -26466,6 +26472,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
Expand Down Expand Up @@ -26766,6 +26773,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
Expand Down
8 changes: 8 additions & 0 deletions components/table/__tests__/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2767,6 +2767,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
Expand Down Expand Up @@ -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"
/>
Expand Down Expand Up @@ -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"
/>
Expand Down Expand Up @@ -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"
/>
Expand Down Expand Up @@ -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"
/>
Expand Down Expand Up @@ -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"
/>
Expand Down Expand Up @@ -20602,6 +20608,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
Expand Down Expand Up @@ -20902,6 +20909,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
Expand Down
1 change: 1 addition & 0 deletions components/table/hooks/useSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6550,6 +6550,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
Expand Down Expand Up @@ -7399,6 +7400,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
Expand Down
2 changes: 2 additions & 0 deletions components/transfer/__tests__/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4044,6 +4044,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
Expand Down Expand Up @@ -4764,6 +4765,7 @@ Array [
class="ant-checkbox"
>
<input
aria-label="Select all"
class="ant-checkbox-input"
type="checkbox"
/>
Expand Down

0 comments on commit 46a0c60

Please sign in to comment.