mirror of https://github.com/sveltejs/svelte
dont transform bidi transitions twice - fixes #962
parent
832311a732
commit
3350f166db
@ -0,0 +1,21 @@
|
|||||||
|
export default {
|
||||||
|
data: {
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
|
||||||
|
test(assert, component, target, window, raf) {
|
||||||
|
component.set({ visible: true });
|
||||||
|
const div = target.querySelector('div');
|
||||||
|
assert.equal(div.foo, 0);
|
||||||
|
|
||||||
|
raf.tick(50);
|
||||||
|
assert.equal(div.foo, 100);
|
||||||
|
|
||||||
|
raf.tick(100);
|
||||||
|
assert.equal(div.foo, 200);
|
||||||
|
|
||||||
|
raf.tick(101);
|
||||||
|
|
||||||
|
component.destroy();
|
||||||
|
},
|
||||||
|
};
|
@ -0,0 +1,18 @@
|
|||||||
|
{{#if visible}}
|
||||||
|
<div transition:foo='{k: duration}'>fades in</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
transitions: {
|
||||||
|
foo(node, params) {
|
||||||
|
return {
|
||||||
|
duration: 100,
|
||||||
|
tick: t => {
|
||||||
|
node.foo = t * params.k;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue