Skip to content

TextArea/TextField don‘t show focus outline on initial focus when autoFocus={true} #9047

@lensbart

Description

@lensbart

Provide a general summary of the issue here

<TextArea autoFocus={true} /> and <TextField autoFocus={true} /> don’t show a focus outline on initial render. Only when blurring-and-refocusing, or when faux-autofocusing using autoFocus={false} and useEffect(() => inputElement.focus(), []}.

I think this comment might be related, because TextArea uses useFocusRing instead of useFocusable (as mentioned in that comment).

🤔 Expected Behavior?

Outline shown when autoFocus={true}

😯 Current Behavior

Outline not shown when autoFocus={true}

💁 Possible Solution

Might have something to do with these lines, but I don’t fully understand the logic

🔦 Context

No response

🖥️ Steps to Reproduce

The behavior can be seen in the Storybook for TextField by setting autoFocus to true and then reloading the canvas

Version

1.13.0

What browsers are you seeing the problem on?

Safari

If other, please specify.

No response

What operating system are you using?

macOS Tahoe

🧢 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