-
Notifications
You must be signed in to change notification settings - Fork 597
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
Add openOnFocus
prop to AutocompleteInput
#4555
Conversation
🦋 Changeset detectedLatest commit: 0c1557c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
I wonder if we'd want up/down arrow keys to open the menu if this prop is used. For example, if you set |
size-limit report 📦
|
I think this makes sense as behavior! Let me implement that tomorrow! |
Co-authored-by: Kendall Gassner <[email protected]>
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!
* Add `openOnFocus` prop to `AutocompleteInput` Towards github/accessibility-audits#7437 * Add changeset * Fix JSON formatting * Allow up and down to open menu if not already open * update hook * Update packages/react/src/Autocomplete/AutocompleteInput.tsx Co-authored-by: Kendall Gassner <[email protected]> --------- Co-authored-by: Kendall Gassner <[email protected]>
Unblocks github/accessibility-audits#7437
The audit issue notes that when an
AutocompleteInput
is the first field in a form with errors (and thus when it needs to be auto-focused after submission to help the user discover and address errors), the autocomplete menu popping up automatically on focus 1) causes NVDA+Firefox to miss reading out an associated error message/FormControl.Validation
even when linked viaaria-describedby
and 2) visually obscures the error message, which makes discovering what went wrong harder.Offering a prop to optionally disable the menu appearing on focus improves these two users experiences; the menu will still render when the user types in the autocomplete's input field.
Changelog
New
openOnFocus
prop which defaults totrue
(current behavior) toAutocompleteInput
Changed
Removed
Rollout strategy
Testing & Reviewing
Merge checklist