Closed bennypowers closed 2 months ago
Latest commit: 9f449904ae31465fab8fb92593805e48bc963601
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Name | Link |
---|---|
Latest commit | c7bc562e89c93254f38949876c82073f3b0fa608 |
Deploy Preview | https://deploy-preview-2740--patternfly-elements.netlify.app/ |
To edit notification comments on pull requests, go to your Netlify site settings.
@nikkimk @adamjohnson is this better? Now, the button will have text content from either the selected item or the placeholder, be described by the placeholder, and be labelled by the input (in the case of typeahead) or directly with the computed label text (based on FACE labels).
these changes cause an axe failure on the button, which you can see on the actions page, so i went back to using the placeholder in certain circumstances
When reviewing, maybe forget about the usage of the word "placeholder", which isn't exactly the same thing here as <input placeholder>
.
We shouldn't use values from the options to label the entire select list--especially considering those values can change.
For example, if we have a select menu for choosing a system's status, its label should always be something like "Current system status," and not "Running". Here's a screencap from our docs:
For an example of what we could do, the WAI Select-Only Combobox Example uses aria-labelledby
to point to the text just preceding the select list to label it. We could do something like this, even if that text is placed offscreen.
@nikkimk 's notes from chat
Only thing I noticed with screen readers is that the placeholder text is always read when the button receives focus, even when another value in the list is currently selected. (If the placeholder is currently selected, it is read twice.)
For example, when the above button receives focus after I've selected "Orange" (which is not the placeholder value), NVDA announces Color, combobox, Orange, collapsed, opens list, Select a value
on focus:
So you get the label, role, selected value, expanded state, button action, and placeholder value.
By comparison, the above WAI Combobox announces Favorite Fruit, combobox, Blueberry, collapsed, opens list
. In other words, everything but the placeholder value from our demo.
Other screen readers act similarly. VoiceOver on the Mac actually does something especially odd. It trims the last letter of the placeholder (e.g., "Select a valu" without the "e" at the end).
I think we can add an aria hidden on the placeholder text whenever there's a selected value
@hellogreg 73014286 addresses this, you can test in at https://patternflyelements.org/elements/select/demo/
Thanks, @bennypowers . The current version has this odd flickering (video link) when triggering the button via either mouse or keyboard. You also then can't collapse the list, except by choosing an option.
What I did
Testing Instructions
Notes to Reviewers