mirror of https://github.com/sveltejs/svelte
fix: handle intro global transition propagation correctly (#9515)
* fix: stop propagating global intros * fix: stop propagating global intros * add testpull/9519/head
parent
e0271f0fc7
commit
f886bc133e
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: do not propagate global intro transitions
|
@ -0,0 +1,25 @@
|
||||
import { flushSync } from '../../../../src/main/main-client';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: '<div>0</div><button>toggle</button>',
|
||||
async test({ assert, component, target, raf }) {
|
||||
component.value = 2;
|
||||
|
||||
const [button] = /** @type {NodeListOf<HTMLButtonElement>} */ (
|
||||
target.querySelectorAll('button')
|
||||
);
|
||||
|
||||
raf.tick(0);
|
||||
|
||||
assert.htmlEqual(target.innerHTML, '<div>2</div><button>toggle</button>');
|
||||
|
||||
flushSync(() => {
|
||||
button.click();
|
||||
});
|
||||
|
||||
raf.tick(0);
|
||||
|
||||
assert.htmlEqual(target.innerHTML, '<button>toggle</button>');
|
||||
}
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
<script>
|
||||
export let value = 0;
|
||||
export let toggle = true;
|
||||
|
||||
function foo(node, params) {
|
||||
return {
|
||||
duration: 100,
|
||||
tick: (t, u) => {
|
||||
node.foo = t;
|
||||
node.oof = u;
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if toggle}
|
||||
{#key value}
|
||||
<div in:foo|global>{value}</div>
|
||||
{/key}
|
||||
{/if}
|
||||
|
||||
<button on:click={() => toggle = !toggle}>toggle</button>
|
Loading…
Reference in new issue