Skip to content

Focus behavior change between version 3.20.5 and 3.21.0 of @react-aria/focus #8788

@jmclain20

Description

@jmclain20

Provide a general summary of the issue here

On 3.20.5 we were able to have visibility: hidden set on inputs and the behavior using focus scope with tab and useFocusManager would skip over these inputs to the next available input. This seems to have been broken in 3.21.0 and now the focus just stays locked on that last available input before the visibility hidden input.

🤔 Expected Behavior?

The focus should work like 3.20.5.

😯 Current Behavior

The focus gets trapped on the first input.

💁 Possible Solution

No response

🔦 Context

We have conditional inputs that are sometimes hidden visibly from the user but are still allowed to be interacted with via assisting devices.

🖥️ Steps to Reproduce

On 3.20.5 the following example allows for tabbing between the first and third input. On 3.21.0 the focus gets trapped on the first input.

<FocusScope>
    <input />
    <input css={{visibility:hidden}} />
    <input />
</FocusScope>

Version

LTS React-Aria

What browsers are you seeing the problem on?

Chrome, Safari

If other, please specify.

No response

What operating system are you using?

MACos

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions