Skip to content

[field-base] Add support for focus({ focusVisible: true }) to force setting focus-ring #1357

@jouni

Description

@jouni

Focus ring on touch devices

<vaadin-text-field autofocus>

The field gets the focus-ring (and focused, judging by the blue label text) state also on touch devices. It should not, as at least iOS prevents autofocus from working at all (it will not focus the field and open the keyboard).

No focus ring when focusing programmatically

textField.focus();

Works differently from autofocus and does not apply the focus-ring state, although it should. You can use the same https://vaadin-login-proto.glitch.me example to see the behavior (click the “Log in” button which moves the focus to the “Username” field).

Since the focus is moved programmatically (vs by the user) we should let the user know visually more prominently where the focus has been moved.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions