@leavepulse/ui 0.49.0 → 0.49.1
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.
|
@@ -84,8 +84,8 @@ function useShift(options = {}) {
|
|
|
84
84
|
settleTimer = setTimeout(() => {
|
|
85
85
|
inFlight = false;
|
|
86
86
|
resizing.value = false;
|
|
87
|
-
node.style.height = "";
|
|
88
|
-
node.style.width = "";
|
|
87
|
+
if (wantsHeight()) node.style.height = "";
|
|
88
|
+
if (wantsWidth()) node.style.width = "";
|
|
89
89
|
lastHeight = node.offsetHeight;
|
|
90
90
|
lastWidth = node.offsetWidth;
|
|
91
91
|
}, wait);
|
|
@@ -122,8 +122,8 @@ function useShift(options = {}) {
|
|
|
122
122
|
if (wantsWidth()) node.style.width = `${lastWidth}px`;
|
|
123
123
|
raf = requestAnimationFrame(() => {
|
|
124
124
|
tweening.value = true;
|
|
125
|
-
node.style.height = "";
|
|
126
|
-
node.style.width = "";
|
|
125
|
+
if (wantsHeight()) node.style.height = "";
|
|
126
|
+
if (wantsWidth()) node.style.width = "";
|
|
127
127
|
});
|
|
128
128
|
const watchChildren = () => {
|
|
129
129
|
if (!ro) return;
|
package/package.json
CHANGED
|
@@ -233,9 +233,12 @@ export function useShift(
|
|
|
233
233
|
resizing.value = false
|
|
234
234
|
// Released once the box has arrived. A size left pinned in pixels stops
|
|
235
235
|
// being a starting point and becomes a cap: content that grows afterwards
|
|
236
|
-
// is clipped, and `max-*` can no longer size the element itself.
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
// is clipped, and `max-*` can no longer size the element itself. Only
|
|
237
|
+
// the axes this composable sizes: the other may carry the host's own
|
|
238
|
+
// inline size (a dialog's `width` beside a height-only tween), and
|
|
239
|
+
// clearing it let the box spread to the window's edges.
|
|
240
|
+
if (wantsHeight()) node.style.height = ""
|
|
241
|
+
if (wantsWidth()) node.style.width = ""
|
|
239
242
|
// Re-read rather than trusting the target: a `max-*` may have clamped the
|
|
240
243
|
// box short of it, and the next tween has to start from where it sits.
|
|
241
244
|
lastHeight = node.offsetHeight
|
|
@@ -284,8 +287,8 @@ export function useShift(
|
|
|
284
287
|
// from, and holding it would cap the box at its opening size.
|
|
285
288
|
raf = requestAnimationFrame(() => {
|
|
286
289
|
tweening.value = true
|
|
287
|
-
node.style.height = ""
|
|
288
|
-
node.style.width = ""
|
|
290
|
+
if (wantsHeight()) node.style.height = ""
|
|
291
|
+
if (wantsWidth()) node.style.width = ""
|
|
289
292
|
})
|
|
290
293
|
|
|
291
294
|
// Two triggers, since either can move the size alone: the resize observer
|