Skip to content

Commit

Permalink
fix: aria-activedescendant ARIA attributes must conform to valid valu…
Browse files Browse the repository at this point in the history
…es (#966)
  • Loading branch information
afc163 committed Jul 25, 2023
1 parent 3118cbc commit b18e466
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 18 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"jsonp": "^0.2.1",
"np": "^7.5.0",
"prettier": "^2.7.1",
"querystring": "^0.2.1",
"rc-dialog": "^9.0.0",
"rc-test": "^7.0.9",
"typescript": "^4.2.3"
Expand Down
2 changes: 1 addition & 1 deletion src/Selector/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const Input: React.RefForwardingComponent<InputRef, InputProps> = (
'aria-owns': `${id}_list`,
'aria-autocomplete': 'list',
'aria-controls': `${id}_list`,
'aria-activedescendant': activeDescendantId,
'aria-activedescendant': open ? activeDescendantId : undefined,
...attrs,
value: editable ? value : '',
maxLength,
Expand Down
2 changes: 0 additions & 2 deletions tests/__snapshots__/Combobox.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ exports[`Select.Combobox renders controlled correctly 1`] = `
class="rc-select-selection-search"
>
<input
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="false"
Expand Down Expand Up @@ -45,7 +44,6 @@ exports[`Select.Combobox renders correctly 1`] = `
class="rc-select-selection-search"
>
<input
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="false"
Expand Down
4 changes: 0 additions & 4 deletions tests/__snapshots__/Multiple.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ exports[`Select.Multiple render not display maxTagPlaceholder if maxTagCount not
style="width: 0px;"
>
<input
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="false"
Expand Down Expand Up @@ -140,7 +139,6 @@ exports[`Select.Multiple render truncates tags by maxTagCount and show maxTagPla
style="width: 0px;"
>
<input
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="false"
Expand Down Expand Up @@ -258,7 +256,6 @@ exports[`Select.Multiple render truncates tags by maxTagCount and show maxTagPla
style="width: 0px;"
>
<input
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="false"
Expand Down Expand Up @@ -360,7 +357,6 @@ exports[`Select.Multiple render truncates values by maxTagTextLength 1`] = `
style="width: 0px;"
>
<input
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="false"
Expand Down
6 changes: 0 additions & 6 deletions tests/__snapshots__/Select.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ exports[`Select.Basic no search 1`] = `
class="rc-select-selection-search"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-expanded="false"
Expand Down Expand Up @@ -158,7 +157,6 @@ exports[`Select.Basic render renders aria-attributes correctly 1`] = `
class="antd-selection-search"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-expanded="false"
Expand Down Expand Up @@ -206,7 +204,6 @@ exports[`Select.Basic render renders correctly 1`] = `
class="antd-selection-search"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-expanded="false"
Expand Down Expand Up @@ -254,7 +251,6 @@ exports[`Select.Basic render renders data-attributes correctly 1`] = `
class="antd-selection-search"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-expanded="false"
Expand Down Expand Up @@ -300,7 +296,6 @@ exports[`Select.Basic render renders disabled select correctly 1`] = `
class="antd-selection-search"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-expanded="false"
Expand Down Expand Up @@ -338,7 +333,6 @@ exports[`Select.Basic render renders role prop correctly 1`] = `
class="antd-selection-search"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-expanded="false"
Expand Down
4 changes: 0 additions & 4 deletions tests/__snapshots__/Tags.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ exports[`Select.Tags render not display maxTagPlaceholder if maxTagCount not rea
style="width: 0px;"
>
<input
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="false"
Expand Down Expand Up @@ -366,7 +365,6 @@ exports[`Select.Tags render truncates tags by maxTagCount and show maxTagPlaceho
style="width: 0px;"
>
<input
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="false"
Expand Down Expand Up @@ -481,7 +479,6 @@ exports[`Select.Tags render truncates tags by maxTagCount and show maxTagPlaceho
style="width: 0px;"
>
<input
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="false"
Expand Down Expand Up @@ -580,7 +577,6 @@ exports[`Select.Tags render truncates values by maxTagTextLength 1`] = `
style="width: 0px;"
>
<input
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
aria-autocomplete="list"
aria-controls="rc_select_TEST_OR_SSR_list"
aria-expanded="false"
Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/ssr.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Select.SSR should work 1`] = `"<div class="rc-select rc-select-single"><div class="rc-select-selector"><span class="rc-select-selection-search"><input type="search" autoComplete="off" class="rc-select-selection-search-input" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-owns="undefined_list" aria-autocomplete="list" aria-controls="undefined_list" aria-activedescendant="undefined_list_0" value="" readonly="" unselectable="on" style="opacity:0"/></span><span class="rc-select-selection-placeholder"></span></div></div>"`;
exports[`Select.SSR should work 1`] = `"<div class="rc-select rc-select-single"><div class="rc-select-selector"><span class="rc-select-selection-search"><input type="search" autoComplete="off" class="rc-select-selection-search-input" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-owns="undefined_list" aria-autocomplete="list" aria-controls="undefined_list" value="" readonly="" unselectable="on" style="opacity:0"/></span><span class="rc-select-selection-placeholder"></span></div></div>"`;

0 comments on commit b18e466

Please sign in to comment.