-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#2336): Fields without description are losing focus when an error…
… is shown for the first time. 🐛 Bug Report If you have a TextField without a description, the focus on the field is lost as soon as an error is shown for the first time. This probably happens for all the fields that have Helper Text option. 🤔 Expected Behavior Field should keep focus. 😯 Current Behavior Field is losing the focus when the error is shown. 💁 Possible Solution Probably use a useLayoutEffect to restore focus to the input if the input had focus previously. 🔦 Context 💻 Code Sample https://codesandbox.io/s/lost-focus-44wtq 🌍 Your Environment Software Version(s) react-spectrum 3.14.0 Browser Chrome Operating System macOS 11.6
- Loading branch information
1 parent
b4a3821
commit 1ae7d1a
Showing
3 changed files
with
8 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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