-
Notifications
You must be signed in to change notification settings - Fork 91
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
feat(dropdowns): allow Select to receive alphanumeric selection #786
Conversation
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 fantastic to me!
1fb93c5
to
9426a40
Compare
9426a40
to
3c0bee8
Compare
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.
LGTM, this is awesome!
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.
Can you spin-up a deployment for us to check-out the results against current examples?
Here is a draft publish for review: https://5ef634b66a1798021448604b--garden-preview-v1.netlify.app/dropdowns/#select-usage I also just realized that we intercept Testing UpdateIt seems jsdom doesn't implement |
Ref http://nativeformelements.com/. It appears that a timeout is incorporated into the native |
@jzempel here is an updated draft deploy that allows |
Here is another draft: https://5efa2e5dc3b0af02161b8a42--garden-preview-v1.netlify.app/dropdowns/#menu-usage This includes:
|
Description
This PR allows users to highlight
Select
values based on the W3C list patternDetail
Solution
I based this interaction from the Collapsible Dropdown List W3C example as well as the Reach UI Listbox example.
The type multiple characters in rapid succession feature adds some complexity to this implementation. To accomplish this I:
innerText
of each<Item>
on renderitemToString()
as this is calculated from the value, not the text providedSelect
keyDown, start a timeout for any alphanumeric keyDeployment
As this is large net-positive for a11y and user experience, I have started this work in the v7 branch. With a majority of consumers still using v7 I wanted to validate that an approach could work across both v7 and v8 before continuing. This same work will be cherry-picked (as much as possible) onto v8 after approval.
Remaining a11y Items
A common feature of the listbox pattern is allowing the alphanumeric key press to select a matching value when the dropdown is closed. This isn't currently possible with our Downshift implementation.
Due to #613 we are unable to fully render the
Item
elements. This makes it impossible for us to know the current Downshift index andinnerText
values.Checklist
designer as a reviewer)
🌐 Styleguidist demo is up-to-date (yarn start
)⬅️ renders as expected with reversed (RTL) direction🤘 renders as expected with Bedrock CSS (?bedrock
)📝 tested in Chrome, Firefox, Safari, Edge, and IE11