-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Provide a general summary of the issue here
The FocusRing
component doesn't trigger focus on render when autoFocus
is true
.
🤔 Expected Behavior?
I expect FocusRing
to focus the element passed via children
on render when autoFocus
is true
.
😯 Current Behavior
No focus is given on render. The component does apply focusClass
and focusRingClass
when applying focus with the keyboard manually.
💁 Possible Solution
I suspect there might be something flawed with the logic seen here: https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/focus/src/useFocusRing.ts#L48
🔦 Context
No response
🖥️ Steps to Reproduce
I have produced a minimal reproduction here: https://codesandbox.io/p/sandbox/focus-ring-bug-t97nxp
I also included the Button from React Aria Components to show that that works as expected.
Version
3.37.0
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Windows
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
mikidoi
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation