This repository was archived by the owner on Feb 9, 2026. It is now read-only.
Remove useEffect to Prevent Auto-Focus in AutosuggestField#53
Merged
nicholasio merged 2 commits intodevelopfrom Apr 25, 2024
Merged
Remove useEffect to Prevent Auto-Focus in AutosuggestField#53nicholasio merged 2 commits intodevelopfrom
nicholasio merged 2 commits intodevelopfrom
Conversation
nicholasio
approved these changes
Apr 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
The
AutosuggestFieldcomponent employs a lifecycle method that automatically focuses on the input when rendered. This behavior introduces an accessibility (a11y) issue. Consider the following scenario:When
AutosuggestFieldis positioned deep within the DOM, after the main navigation and other links, users who land on the page must navigate backwards (using Shift + Tab) to reach the main navigation. This method is non-intuitive and disrupts the functionality of skip links, which facilitate faster navigation.Generally, manipulating focus without considering the context of surrounding components is not an advisable practice.
Closes #52
Changelog Entry
Credits
Props @dmtrmrv
Checklist: