-
-
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(VTextField): use intersect to recalculate elements width #9341
fix(VTextField): use intersect to recalculate elements width #9341
Conversation
@johnleider this is improved version of #9300 |
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.
Please create corresponding tests
@Djaler Could you message me in the community please, https://community.vuetifyjs.com |
a119753
to
e71b995
Compare
Hey @Djaler, TravisBuddy Request Identifier: 35025550-12d9-11ea-b2b3-cdec09be7ce8 |
@johnleider I updated a code according to what we discussed. Also, @sh7dm, I added a test to the mixin |
@KaelWD can you look over the mixin for inaccuracies in typescript implementation. |
e71b995
to
33b2f67
Compare
completed
64414b9
to
2f5b9fb
Compare
@johnleider can you check it? |
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.
After reviewing this again, I'm not sure why we are re-rolling up the intersectable functionality. We already have the v-intersect directive. We could essentially just hook into the render function and dynamically add the directive.
@@ -0,0 +1,43 @@ | |||
import Vue from 'vue' |
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.
Change to:
// Utilities
import { consoleWarn } '../../util/console'
// Types
import Vue from 'vue'
@johnleider how can we add directive from mixin? |
It's alright. Could make the options type safe by being a wrapping function instead of a mixin factory, but that gets pretty complicated.
Yeah I don't think you really can. The mixin could have everything else though and the implementing component would just have to make sure to use the directive somewhere. EDIT: maybe mounted () {
Intersect.inserted(this.$el, options)
}
destroyed () {
Intersect.unbind(this.$el)
} |
Do you mean, in implementing component we will have something like
, where |
Yeah. See my edit for another idea. |
Do you mean to get rid of mixin at all? |
No, the mixin can do that. |
Oh, I did not get it that Intersection.inserted is a way to initialize directive. Yeah, this could work |
2f5b9fb
to
3341a83
Compare
3341a83
to
005e4d8
Compare
@KaelWD @johnleider done |
So what about it, guys? |
fixes #9299
Description
Use IntersectionObserver (if it available) to recalculate element width after input becomes visible,
Motivation and Context
Cause they have zero width on mount in hidden state (inside expansion panel, for example)
#9299
How Has This Been Tested?
visually
Markup:
https://codepen.io/djaler/pen/oNNXywM
Types of changes
Checklist:
master
for bug fixes and documentation updates,dev
for new features and breaking changes).