Skip to content

fix(VTextField): pass title attribute to root element instead of inner input#22756

Open
mixelburg wants to merge 6 commits intovuetifyjs:masterfrom
mixelburg:fix/vselect-title-attr-22730
Open

fix(VTextField): pass title attribute to root element instead of inner input#22756
mixelburg wants to merge 6 commits intovuetifyjs:masterfrom
mixelburg:fix/vselect-title-attr-22730

Conversation

@mixelburg
Copy link
Copy Markdown
Contributor

Fixes #22730

Problem

The native HTML title attribute (which renders a browser tooltip on hover) did not work on v-select, v-text-field, and other input components.

Root cause: filterInputAttrs in src/util/helpers.ts splits component attrs between:

  • rootAttrs → forwarded to the outer wrapper element
  • inputAttrs → forwarded to the inner <input> element

The filter's allowlist for rootAttrs was ['class', 'style', 'id', 'inert', /^data-/]. The title attribute was not included, so it ended up on the inner <input>.

In VSelect, the inner <input> has pointer-events: none (set intentionally in VSelect.sass to allow the outer cursor: pointer style). Because the element doesn't receive pointer events, the browser never triggers the native tooltip — the attribute is silently ignored.

Fix

Add 'title' to the rootAttrs allowlist in filterInputAttrs. The title attribute then lands on the outer .v-field div, which does receive pointer events and correctly renders the tooltip.

This fix applies to all components that use filterInputAttrs: VSelect, VTextField, VCombobox, VAutocomplete, VFileInput, etc.

Also adds a browser test verifying that title appears on the .v-field element and not on the inner <input>.

mixelburg and others added 6 commits March 24, 2026 22:17
Previously, focus was only returned to the activator element when the
active element was inside the overlay content at the time Escape was pressed.
This caused focus to be lost when:
- The menu was opened via click but focus was not captured into the content
- The activator is not keyboard-focusable (e.g. coordinate-positioned menus)

Always attempt to return focus to the activator on Escape. If the activator
is not focusable (no tabIndex), the focus() call is a no-op, preserving
existing behaviour for coordinate-based menus.

Fixes vuetifyjs#22560
…r input

The filterInputAttrs helper splits component attrs between the root element
and the inner <input>. Previously 'title' was not included in the rootAttrs
list, so it was forwarded to the <input> element.

In VSelect the inner <input> has pointer-events: none (necessary for the
selection cursor behavior), which silently prevents native browser title
tooltips from appearing because the user's cursor can never hover the input.

Adding 'title' to the rootAttrs list keeps it on the outer .v-field div
which does receive pointer events, so the native tooltip works correctly.
Applies to VSelect, VTextField, VCombobox, VAutocomplete, VFileInput, and
any other component that uses filterInputAttrs.

Fixes vuetifyjs#22730
The globalTop ref in useStack is updated via setTimeout, so after opening
the menu we need to waitFor visibility assertions to be stable before
pressing Escape and checking the closed state.

Fixes browser test flakiness in 'returns focus to activator on Escape'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report][4.0.2] title attribute does not work on V-Select

1 participant