Uh oh!
There was an error while loading. Please reload this page.
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 |
TylerJDev
commented
May 9, 2024
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 📦
|
JoyceZhu
commented
May 10, 2024
I think this makes sense as behavior! Let me implement that tomorrow! |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Kendall Gassner <kendallgassner@github.com>
* 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 <kendallgassner@github.com> --------- Co-authored-by: Kendall Gassner <kendallgassner@github.com>
Unblocks github/accessibility-audits#7437
The audit issue notes that when an
AutocompleteInputis 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.Validationeven when linked viaaria-describedbyand 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
openOnFocusprop which defaults totrue(current behavior) toAutocompleteInputChanged
Removed
Rollout strategy
Testing & Reviewing
Merge checklist