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
refactor(docs-infra): reimplement aio-select using mat-select #45937
refactor(docs-infra): reimplement aio-select using mat-select #45937
Conversation
it('should contain a symbol if hasSymbol is true', () => { | ||
expect(getButtonSymbol()).toEqual(null); | ||
host.showSymbol = true; | ||
fixture.detectChanges(); | ||
expect(getButtonSymbol()).not.toEqual(null); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one unit test I actually wanted to keep but I had issues implementing it since the span with the symbol is inside the mat-select and I couldn't find a way to query for it (I am not even sure if the mat-select content gets rendered in the tests) 😓
You can preview e11d9f4 at https://pr45937-e11d9f4.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally lgtm 👍
I wonder what the payload size change would be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's some api-list tests that relied on a CSS class that was changed here that needs to be addressed. That and the simple lint issue should get this ready to merge.
|
||
import { MatSelectHarness } from '@angular/material/select/testing'; | ||
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { MatFormFieldHarness } from "@angular/material/form-field/testing"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { MatFormFieldHarness } from "@angular/material/form-field/testing"; | |
import { MatFormFieldHarness } from '@angular/material/form-field/testing'; |
Looks like aio tests are failing lint checks because of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool yeah, sorry for the failing tests, I'm on it 🙂
yeah I was wondering the same too, I just thought of opening the PR and see what the ci says 🙈 let me fix the issues and will see how it looks 😅 |
the current aio-select component is implemented using buttons instead of a native select element, this causes the component not to be very accessible (screen readers for example do not tell the user that there is a selection available, and not all keyboard navigation functionalities work as per the wai-aria guidelines)
260579f
to
420f5bb
Compare
await dropdown.element(by.css('.form-select-button')).click(); | ||
const menuItem = dropdown.element(by.cssContainingText('.form-select-dropdown li', itemName)); | ||
await dropdown.element(by.css('mat-select')).click(); | ||
const menuItem = element(by.cssContainingText('mat-option', itemName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here I had to remove the dropdown
scoping/prefix, the issue being that the select options sit in their cdk-overlay-container div which is not a child of the dropdown so I needed to make the selection generic
(PS: I looked into using the material harnesses but I think that they have issues with protractor, with it being deprecated and whatnot, please let me know if I'm mistaken 😓)
@gkalpak the results are out.... Sorry I had no idea it would cause such a drastic increase! 😓 😱 I'm just closing this PR and will create a new one using a native select element (in that way I can also keep the look and feel exactly the same) @gkalpak and @jessicajaniuk thanks a lot for the reviewing the PR 🙂 , sorry for the inconvenience 😓 |
improve the accessibility of the aio-select component so that it is clear for screen reader users its functionality (currently it is presented as a simple button), following the WAI-ARIA authoring practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox) A first attempt in improving the accessibility of the component has been tried in PR angular#45937 by replacing it with the material select component, such implementation has however been scrapped since the increase of payload sizes has proven prohibitively large (also note that given native select elements haven't been used given the lack of syling options for such elements)
improve the accessibility of the aio-select component so that it is clear for screen reader users its functionality (currently it is presented as a simple button), following the WAI-ARIA authoring practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox) A first attempt in improving the accessibility of the component has been tried in PR angular#45937 by replacing it with the material select component, such implementation has however been scrapped since the increase of payload sizes has proven prohibitively large (also note that given native select elements haven't been used given the lack of syling options for such elements)
improve the accessibility of the aio-select component so that it is clear for screen reader users its functionality (currently it is presented as a simple button), following the WAI-ARIA authoring practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox) A first attempt in improving the accessibility of the component has been tried in PR angular#45937 by replacing it with the material select component, such implementation has however been scrapped since the increase of payload sizes has proven prohibitively large (also note that given native select elements haven't been used given the lack of syling options for such elements)
improve the accessibility of the aio-select component so that it is clear for screen reader users its functionality (currently it is presented as a simple button), following the WAI-ARIA authoring practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox) A first attempt in improving the accessibility of the component has been tried in PR angular#45937 by replacing it with the material select component, such implementation has however been scrapped since the increase of payload sizes has proven prohibitively large (also note that given native select elements haven't been used given the lack of syling options for such elements)
improve the accessibility of the aio-select component so that it is clear for screen reader users its functionality (currently it is presented as a simple button), following the WAI-ARIA authoring practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox) A first attempt in improving the accessibility of the component has been tried in PR angular#45937 by replacing it with the material select component, such implementation has however been scrapped since the increase of payload sizes has proven prohibitively large (also note that given native select elements haven't been used given the lack of syling options for such elements)
improve the accessibility of the aio-select component so that it is clear for screen reader users its functionality (currently it is presented as a simple button), following the WAI-ARIA authoring practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox) A first attempt in improving the accessibility of the component has been tried in PR angular#45937 by replacing it with the material select component, such implementation has however been scrapped since the increase of payload sizes has proven prohibitively large (also note that given native select elements haven't been used given the lack of syling options for such elements)
improve the accessibility of the aio-select component so that it is clear for screen reader users its functionality (currently it is presented as a simple button), following the WAI-ARIA authoring practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox) A first attempt in improving the accessibility of the component has been tried in PR angular#45937 by replacing it with the material select component, such implementation has however been scrapped since the increase of payload sizes has proven prohibitively large (also note that given native select elements haven't been used given the lack of syling options for such elements)
improve the accessibility of the aio-select component so that it is clear for screen reader users its functionality (currently it is presented as a simple button), following the WAI-ARIA authoring practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox) A first attempt in improving the accessibility of the component has been tried in PR angular#45937 by replacing it with the material select component, such implementation has however been scrapped since the increase of payload sizes has proven prohibitively large (also note that given native select elements haven't been used given the lack of syling options for such elements)
improve the accessibility of the aio-select component so that it is clear for screen reader users its functionality (currently it is presented as a simple button), following the WAI-ARIA authoring practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox) A first attempt in improving the accessibility of the component has been tried in PR #45937 by replacing it with the material select component, such implementation has however been scrapped since the increase of payload sizes has proven prohibitively large (also note that given native select elements haven't been used given the lack of syling options for such elements) PR Close #46013
improve the accessibility of the aio-select component so that it is clear for screen reader users its functionality (currently it is presented as a simple button), following the WAI-ARIA authoring practices (see: https://www.w3.org/TR/wai-aria-practices/#combobox) A first attempt in improving the accessibility of the component has been tried in PR #45937 by replacing it with the material select component, such implementation has however been scrapped since the increase of payload sizes has proven prohibitively large (also note that given native select elements haven't been used given the lack of syling options for such elements) PR Close #46013
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
the current aio-select component is implemented using buttons instead of
a native select element, this causes the component not to be very
accessible (screen readers for example do not tell the user that there
is a selection available, and not all keyboard navigation
functionalities work as per the wai-aria guidelines)
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
As mentioned in the commit description this is an attempt to make
aio-select
more accessible as I believe it currently is notThis is how it currently looks:
What is the new behavior?
This is how it looks with mat-select:
Does this PR introduce a breaking change?
Other information