@leavepulse/ui 0.77.0 → 0.77.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, watch, toValue, onBeforeUnmount } from "vue";
|
|
1
|
+
import { ref, watch, toValue, onBeforeUnmount, nextTick } from "vue";
|
|
2
2
|
import { prefersReducedMotion } from "./easing.js";
|
|
3
3
|
const TWEEN_MS = 160;
|
|
4
4
|
const RETARGET_AFTER_MS = 40;
|
|
@@ -78,8 +78,11 @@ function useShift(options = {}) {
|
|
|
78
78
|
resizing.value = false;
|
|
79
79
|
if (wantsHeight()) node.style.height = "";
|
|
80
80
|
if (wantsWidth()) node.style.width = "";
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
void nextTick(() => {
|
|
82
|
+
if (inFlight) return;
|
|
83
|
+
lastHeight = node.offsetHeight;
|
|
84
|
+
lastWidth = node.offsetWidth;
|
|
85
|
+
});
|
|
83
86
|
}, wait);
|
|
84
87
|
}
|
|
85
88
|
let scrollHost = null;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { onBeforeUnmount, ref, toValue, watch, type MaybeRefOrGetter, type Ref } from "vue"
|
|
1
|
+
import { nextTick, onBeforeUnmount, ref, toValue, watch, type MaybeRefOrGetter, type Ref } from "vue"
|
|
2
2
|
import { prefersReducedMotion } from "./easing"
|
|
3
3
|
|
|
4
4
|
/*
|
|
@@ -235,8 +235,16 @@ export function useShift(
|
|
|
235
235
|
if (wantsWidth()) node.style.width = ""
|
|
236
236
|
// Re-read rather than trusting the target: the layout around may have
|
|
237
237
|
// moved meanwhile, and the next tween has to start from where it sits.
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
// Read after the render that drops the tween's clip, not before: the
|
|
239
|
+
// clip holds a child's margin inside the box, so a box measured with it
|
|
240
|
+
// still on came out taller than it settles (a banner with `mb-4`: 54
|
|
241
|
+
// against 38), and every text change after that, a ticking counter,
|
|
242
|
+
// eased between the two figures once a tick.
|
|
243
|
+
void nextTick(() => {
|
|
244
|
+
if (inFlight) return
|
|
245
|
+
lastHeight = node.offsetHeight
|
|
246
|
+
lastWidth = node.offsetWidth
|
|
247
|
+
})
|
|
240
248
|
}, wait)
|
|
241
249
|
}
|
|
242
250
|
|