Skip to content

Commit 6e3d83f

Browse files
committed
fix(VTextField): set label dimensions on mount
fixes #14391
1 parent 0eec92f commit 6e3d83f

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

packages/vuetify/src/components/VTextField/VTextField.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,15 @@ export default baseMixins.extend<options>().extend({
231231
mounted () {
232232
// #11533
233233
this.$watch(() => this.labelValue, this.setLabelWidth)
234-
235234
this.autofocus && this.tryAutofocus()
236-
237-
requestAnimationFrame(() => (this.isBooted = true))
235+
requestAnimationFrame(() => {
236+
this.isBooted = true
237+
requestAnimationFrame(() => {
238+
if (!this.isIntersecting) {
239+
this.onResize()
240+
}
241+
})
242+
})
238243
},
239244

240245
methods: {

packages/vuetify/src/mixins/intersectable/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export default function intersectable (options: { onVisible: string[] }) {
1111
return Vue.extend({
1212
name: 'intersectable',
1313

14+
data: () => ({
15+
isIntersecting: false,
16+
}),
17+
1418
mounted () {
1519
Intersect.inserted(this.$el as HTMLElement, {
1620
name: 'intersect',
@@ -27,6 +31,8 @@ export default function intersectable (options: { onVisible: string[] }) {
2731

2832
methods: {
2933
onObserve (entries: IntersectionObserverEntry[], observer: IntersectionObserver, isIntersecting: boolean) {
34+
this.isIntersecting = isIntersecting
35+
3036
if (!isIntersecting) return
3137

3238
for (let i = 0, length = options.onVisible.length; i < length; i++) {

0 commit comments

Comments
 (0)