Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify behavior of element.focus( { focusVisible: false } ) #10943

Open
woody-li opened this issue Jan 24, 2025 · 2 comments
Open

Clarify behavior of element.focus( { focusVisible: false } ) #10943

woody-li opened this issue Jan 24, 2025 · 2 comments

Comments

@woody-li
Copy link

woody-li commented Jan 24, 2025

What is the issue with the HTML Standard?

In current specification:

If the value of the focusVisible dictionary member of options is true, or is not present but in an implementation-defined way the user agent determines it would be best to do so, then indicate focus.

It doesn't contain the behavior when focusVisible is false.
When element isn't :focus-visible the focus skip indicates focus.

But when element is in :focus-visible state, and call focus( { focusVisible: false } ). Should it switch from :focus-visible to :focus?

I have a case that user uses the keyboard TAB key to focus, then uses the mouse to move and hover interactively.
Expected to hide the focus ring (outline) but don't change the focus element.

I tried to call focus( { focusVisible: false } ), but no effect.

@woody-li woody-li changed the title Clarify behavior of element.focus( { preventScroll: false } ) Clarify behavior of element.focus( { focusVisible: false } ) Jan 24, 2025
@annevk
Copy link
Member

annevk commented Jan 24, 2025

I think the specification is very clear. False has no effect.

@lukewarlow

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants