🌐 AI搜索 & 代理 主页
Skip to content

Focus in hidden element only work in second attempt #5104

@eduardo-mior

Description

@eduardo-mior

Description

I have element (specifically in my case a <select>) that is hidden (display: none).

When trying to focus the field, the first time it fails, but the second time it works. Why?

I would understand if this never worked. The first time it doesn't work but the second time it works. Why?

Perhaps this is linked to:
#5015
#4950

Link to test case

https://codepen.io/rushyoutuber/pen/PoeodNX

Other informations

My jQuery version is 3.6.1.
I tested this issue on Windows and MacOs, GoogleChrome and Firefox and Safari. The problem always happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions