Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V2] live region implementation #2581

Merged
merged 18 commits into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ab42d2d
remove unnecessary aria props from Input and Group components
gwyneplaine May 2, 2018
9455736
removed unnecessary aria attributes from Menu and Option
gwyneplaine May 2, 2018
b7a3534
remove allytext from loadingIndicator
gwyneplaine May 2, 2018
8bba325
aria hidden true on indicators and svgs
gwyneplaine May 2, 2018
774e979
clean up flow types LoadingIndicator class, add aria-hidden to passe…
gwyneplaine May 2, 2018
27a7d66
initial live-region implementation
gwyneplaine May 7, 2018
612dd62
accessibility wip, added focused options and inputvalue change announ…
gwyneplaine May 8, 2018
363d635
add utility methods for aria live region updates for option focus, se…
gwyneplaine May 8, 2018
7b5089d
removed instructions from menuIsOpen and moved to focusOption and foc…
gwyneplaine Jun 5, 2018
5ccccc3
react-aria-live implementation w aria-live-regions
gwyneplaine Jun 8, 2018
053edd7
add instructions and valueEvent functions for defining ariaLiveSelect…
gwyneplaine Jun 18, 2018
2b17ed4
added accessibility folder, added helper fucntions for aria messages …
gwyneplaine Jun 18, 2018
b064304
update cypress tests
gwyneplaine Jun 22, 2018
8b169af
added null checks for values passed into announceStatus
gwyneplaine Jun 22, 2018
8f5cb3a
update snapshots
gwyneplaine Jun 22, 2018
b8fc4c3
updated tests to reflect changes to accessibility implementation
gwyneplaine Jun 22, 2018
4f799ca
revert menuList innerProps removal for more consistent api
gwyneplaine Jul 3, 2018
3e066cb
optimise constructAriaLiveMssage function for readability
gwyneplaine Jul 3, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions cypress/fixtures/selectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
"clearValues": ".react-select__clear-indicator",
"disabledCheckbox": "#cypress-container-single #cypress-single__disabled-checkbox",
"firstMultiValueRemove":
"#cypress-multi .react-select__multi-value__remove:first",
"#multi-select .react-select__multi-value__remove:first",
"groupColor": "#cypress-container-single #cypress-single-grouped .react-select__group",
"menuGrouped": "#react-select-3-listbox",
"menuMulti": "#react-select-8-listbox",
"menuGrouped": "#grouped-options-single .react-select__menu",
"menuMulti": "#multi-select .react-select__menu",
"menuOption": "[role='option']",
"menuSingle": "#react-select-2-listbox",
"multiSelectDefaultValues": "#cypress-multi .react-select__multi-value",
"multiSelectInput": "#react-select-8-input",
"menuSingle": "#basic-select-single .react-select__menu",
"multiSelectDefaultValues": "#multi-select .react-select__multi-value",
"multiSelectInput": "#react-select-multi-select-input",
"noOptionsValue": ".react-select__menu-notice--no-options",
"placeHolderGrouped": "#cypress-container-single #cypress-single-grouped .react-select__placeholder",
"placeHolderMulti": "#cypress-multi .react-select__placeholder",
"placeHolderSingle": "#cypress-container-single #cypress-single .react-select__placeholder",
"placeHolderGrouped": "#grouped-options-single .react-select__placeholder",
"placeHolderMulti": "#multi-select .react-select__placeholder",
"placeHolderSingle": "#basic-select-single .react-select__placeholder",
"singleGroupedInputValue":
"#cypress-container-single #cypress-single-grouped .react-select__single-value",
"#grouped-options-single .react-select__single-value",
"singleInputValue": ".react-select__single-value",
"singleSelectDefaultValues": "#cypress-container-single .react-select__single-value",
"singleSelectFirstValue": "#cypress-container-single #cypress-single .react-select__single-value",
"singleSelectFirstValue": "#basic-select-single .react-select__single-value",
"singleSelectGroupedInput":
"#cypress-container-single #cypress-single-grouped .react-select__input input",
"singleSelectSingleInput": "#react-select-2-input",
"#grouped-options-single .react-select__input input",
"singleSelectSingleInput": "#react-select-basic-select-single-input",
"toggleMenus": ".react-select__dropdown-indicator",
"toggleMenuGrouped":
"#cypress-container-single #cypress-single-grouped .react-select__dropdown-indicator",
"toggleMenuMulti": "#cypress-multi .react-select__dropdown-indicator",
"toggleMenuSingle": "#cypress-container-single #cypress-single .react-select__dropdown-indicator"
"#grouped-options-single .react-select__dropdown-indicator",
"toggleMenuMulti": "#multi-select .react-select__dropdown-indicator",
"toggleMenuSingle": "#basic-select-single .react-select__dropdown-indicator"
}
19 changes: 9 additions & 10 deletions cypress/integration/select_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ describe('New Select', function() {
cy
.get(selector.toggleMenus)
.should('have.length', 8)
.get(selector.singleSelectSingleInput)
.should('have.attr', 'aria-expanded', 'false')
.get(selector.menuSingle)
.should('not.exist')
.get(selector.toggleMenuSingle)
.click()
.get(selector.singleSelectSingleInput)
.should('have.attr', 'aria-expanded', 'true')
.get(selector.menuSingle)
.should('exist')
.get(selector.menuSingle)
.should('be.visible')
.get(selector.menuOption)
Expand Down Expand Up @@ -90,8 +90,7 @@ describe('New Select', function() {
.get(selector.menuGrouped)
.should('be.visible')
.get(selector.groupColor)
.should('be.visible')
.and('have.attr', 'aria-expanded', 'true');
.should('be.visible');
});
it(
'Should not display the options menu when touched and dragged ' + view,
Expand Down Expand Up @@ -184,12 +183,12 @@ describe('New Select', function() {
'Should select different options using - click and enter ' + view,
function() {
cy
.get(selector.multiSelectInput)
.should('have.attr', 'aria-expanded', 'false')
.get(selector.menuMulti)
.should('not.exist')
.get(selector.toggleMenuMulti)
.click()
.get(selector.multiSelectInput)
.should('have.attr', 'aria-expanded', 'true')
.get(selector.menuMulti)
.should('exist')
.get(selector.menuMulti)
.should('be.visible')
.get(selector.menuOption)
Expand Down
10 changes: 10 additions & 0 deletions docs/Tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class TestSuite extends Component<SuiteProps, SuiteState> {
<div id={`cypress-${idSuffix}`}>
<SelectComp
autoFocus
id={`basic-select-${idSuffix}`}
instanceId={`basic-select-${idSuffix}`}
className="react-select"
defaultValue={colourOptions[0]}
styles={{
Expand Down Expand Up @@ -96,6 +98,8 @@ class TestSuite extends Component<SuiteProps, SuiteState> {
<h4>Grouped</h4>
<div id={`cypress-${idSuffix}-grouped`}>
<SelectComp
id={`grouped-options-${idSuffix}`}
instancePrefix={`grouped-options-${idSuffix}`}
className="react-select"
defaultValue={colourOptions[1]}
options={groupedOptions}
Expand All @@ -118,6 +122,8 @@ class TestSuite extends Component<SuiteProps, SuiteState> {
<div style={{ height: 100 }} />
<pre>{'overflow: hidden; position: absolute;'}</pre>
<SelectComp
id={`portalled-select-${idSuffix}`}
instanceId={`portalled-select-${idSuffix}`}
className="react-select"
defaultValue={colourOptions[0]}
options={colourOptions}
Expand Down Expand Up @@ -194,6 +200,8 @@ export default function Tests() {
<h2>Multi Select</h2>
<div id="cypress-multi">
<Select
id="multi-select"
instanceId="multi-select"
className="react-select"
defaultValue={[colourOptions[2], colourOptions[3]]}
isMulti
Expand All @@ -204,6 +212,8 @@ export default function Tests() {
<h3> Long Values </h3>
<div id={'cypress-long-values'}>
<Select
id="long-value-select"
instsanceId="long-value-select"
className="react-select"
defaultValue={optionLength[3]}
options={optionLength}
Expand Down
Loading