pull/13018/head
Rich Harris 2 years ago
parent db26a5650a
commit 0e4d82d99e

@ -188,7 +188,9 @@ export function transition(flags, element, get_fn, get_params) {
// If a transition is still ongoing, we use the existing options rather than generating
// new ones. This ensures that reversible transitions reverse smoothly, rather than
// jumping to a new spot because (for example) a different `duration` was used
return (current_options ??= get_fn()(element, get_params?.(), { direction }));
return (current_options ??= get_fn()(element, get_params?.() ?? /** @type {P} */ ({}), {
direction
}));
}
/** @type {TransitionManager} */

@ -4,7 +4,7 @@
let foo_text;
let bar_text;
function foo(node, params) {
function foo(node, { duration = 100 }) {
foo_text = node.textContent;
return () => {
@ -13,7 +13,7 @@
}
return {
duration: 100,
duration,
tick: t => {
node.foo = t;
}
@ -21,7 +21,7 @@
};
}
function bar(node, params) {
function bar(node, { duration = 100 }) {
bar_text = node.textContent;
return () => {
@ -30,7 +30,7 @@
}
return {
duration: 100,
duration,
tick: t => {
node.foo = t;
}
@ -43,4 +43,4 @@
<div class="foo" in:foo>a</div>
{:else}
<div out:bar>b</div>
{/if}
{/if}

Loading…
Cancel
Save