fix(VTextField): pass title attribute to root element instead of inner input#22756
Open
mixelburg wants to merge 6 commits intovuetifyjs:masterfrom
Open
fix(VTextField): pass title attribute to root element instead of inner input#22756mixelburg wants to merge 6 commits intovuetifyjs:masterfrom
mixelburg wants to merge 6 commits intovuetifyjs:masterfrom
Conversation
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'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #22730
Problem
The native HTML
titleattribute (which renders a browser tooltip on hover) did not work onv-select,v-text-field, and other input components.Root cause:
filterInputAttrsinsrc/util/helpers.tssplits component attrs between:<input>elementThe filter's allowlist for rootAttrs was
['class', 'style', 'id', 'inert', /^data-/]. Thetitleattribute was not included, so it ended up on the inner<input>.In
VSelect, the inner<input>haspointer-events: none(set intentionally inVSelect.sassto 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 infilterInputAttrs. Thetitleattribute then lands on the outer.v-fielddiv, 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
titleappears on the.v-fieldelement and not on the inner<input>.