Skip to content

[Bug Report][3.11.1] VTextField autofocus strange behaviour on "semi-hidden" fields #22373

@xmorell

Description

@xmorell

Environment

Vuetify Version: 3.11.1
Vue Version: 3.5.25
OS: macOS 10.15.7 (current)

Steps to reproduce

  1. Click on the button to show field 1 (Field hidden and without default slot)
  2. Realize the activeElement is the input (OK)
  3. Click on the butto to show field 2 (Field hidden with default slot)
  4. Realize the activeElement is still the button (Not OK - should be the field)
  5. Click on the button to show field 3 (Visible field with default slot)
  6. Realize the activeElement is the input (OK)

Expected Behavior

I would expect that if a input field with autofocus is rendered, the focus is set there

Actual Behavior

The focus is only set on the input field when the default slot is not used and the text-field is visible

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

It's tricky... on my case I think i have a workaround, but took me some time to realize what was going on... I am doing an editable grid, where the focus is on a "hidden" input field when used clicks on a cell, and the content of the cell is updated automatically when he types...

Images

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions