fix(VSelect): pass title attribute to root element#22951
Open
sridhar-3009 wants to merge 1 commit into
Open
Conversation
Add 'title' to the list of attributes forwarded to the root element in filterInputAttrs, so the HTML title tooltip attribute works on VSelect and all other input-based components (VTextField, VTextarea, VSlider, etc).
Contributor
|
Behavior change might feel like regression
If you the PR states |
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.
Summary
Fixes #22730
The HTML
titleattribute was not being forwarded to the root element onv-select(and other input-based components), so tooltip-on-hover via<v-select title="foo">had no effect.Root cause:
filterInputAttrsinsrc/util/helpers.tssplits fallthrough attributes into two groups:rootAttrs→ applied to the component's root element (class,style,id,inert,data-*, event listeners)inputAttrs→ applied to the inner<input>elementtitlewas not in the root list, so it landed on the inner<input>which is hidden/inert inv-selectand not visible to the user.Fix: Add
'title'to the list of attributes forwarded to the root element infilterInputAttrs.This single-line change fixes
titlefor all components that usefilterInputAttrs:v-selectv-text-fieldv-textareav-slider/v-range-sliderv-otp-inputv-selection-control(checkbox, radio, switch)v-file-uploadv-radio-groupv-imgTest plan
title="foo"to av-selectand verify the browser tooltip appears on hover over the controlv-text-field,v-textarea,v-sliderpnpm test