-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(inputs): display title attribute on root element #12776
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. I think this is a good start but there is a lot of duplication between the components that I'm sure can be DRYed up.
@johnleider As I'm not too knowledged about the Vuetify's component/mixin hierarchy, do you have any recommendation about the placements of those title attr exclusions?
|
@@ -76,6 +76,7 @@ | |||
left: -12px | |||
top: calc(50% - 24px) | |||
margin: 7px | |||
pointer-events: none // Enable title attr hover effect, as ripple blocks the input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested this in all of our supported browsers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually now that you mentioned it, I've noticed that it causes a new bug of ripple not disappearing (probably on mouseout
); but because we've already moved the title to the parent v-input
, the ripple already inherits the title hover effect, so this workaround isn't necessary anymore, and I've removed it in a new commit.
) Display hover effect of title attr even on label of v-text-field, which may have moved outside (above) the input when not outlined, by enabling pointer-events only when it's active (not otherwise). Fix another v-switch bug of ripple effect's event blocking hover. Fix displaying title at all in v-radio. (Also fixed ripple here.) Move title attr to a parent object, making it trigger even on the threshold of input boundaries, increasing its accessibility scope to avoid blind zones. Remove the duplicate title in v-text-field, v-radio, v-switch, and v-checkbox after moving to parent element; specifically VInput, or in the v-radio's case via its own parent. Modified VInput's genInputSlot(): it's being called by components VAutocomplete, VRadioGroup, VSelect, and VTextField (maybe more). This also fixed v-select's issue of title not appearing (vuetifyjs#11253).
Co-authored-by: John Leider <9064066+johnleider@users.noreply.github.com>
) The `pointer-events: none` workaround had caused a new issue of ripple not disappearing on mouseout event and has been removed. As we've moved the title attribute to a parent v-input, it's no longer necessary to disable the ripple's hover effect override, because ripple now properly inherits the title. We'd still need some new workaround if we had to explicitly put title on input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason for not having a separate computed property that reduces the repeating of process.
@johnleider if you mean the process of removing |
Display hover effect of title attr even on label of v-text-field, which may have moved outside (above) the input when not outlined, by enabling pointer-events only when it's active (not otherwise).
Fix another v-switch bug of ripple effect's event blocking hover.
Fix displaying title at all in v-radio. (Also fixed ripple here.)
Move title attr to a parent object, making it trigger even on the threshold of input boundaries, increasing its accessibility scope to avoid blind zones. Remove the duplicate title in v-text-field, v-radio, v-switch, and v-checkbox after moving to parent element; specifically VInput, or in the v-radio's case via its own parent. Modified VInput's genInputSlot(): it's being called by components VAutocomplete, VRadioGroup, VSelect, and VTextField (maybe more).
This also fixed v-select's issue of title not appearing.
Description
Fixes #12775, #11253
Motivation and Context
Title issues, details are in the issue #12775.
Implementation details
There's a related issue for v-select: #11253 where the
pointer-events: none
implementation was described as a workaround to achieve expected behavior. In my implementation I enabledpointer-events: auto
on active label, but there may be a better solution; I was unsuccessful in trying to use something like& :not(&--active)
or& :not(.v-label--active)
withpointer-events: none
instead, intending to avoid settingauto
as an override in case the developer explicitly changes it in a parent component, so you may also reconsider this.The title attribute was moved to the parent, and then removed from child elements by copying the
{ ...this.attrs$ }
anddelete
-ingtitle
field. This shouldn't be necessary, as the duplicate doesn't cause any harm, but will produce cleaner output.How Has This Been Tested?
visually, but without exhaustive testing, so I'd appreciate any help.
Markup:
Types of changes
Checklist:
master
for bug fixes and documentation updates,dev
for new features and backwards compatible changes andnext
for non-backwards compatible changes).