mirror of https://github.com/sveltejs/svelte
scale transition duration by delta - fixes #1221
parent
0ac77019d0
commit
140e2271f7
@ -0,0 +1,12 @@
|
||||
export default {
|
||||
solo: true,
|
||||
test(assert, component, target, window, raf) {
|
||||
component.set({ visible: true });
|
||||
const div = target.querySelector('div');
|
||||
|
||||
raf.tick(25);
|
||||
component.set({ visible: false });
|
||||
|
||||
assert.ok(~div.style.animation.indexOf('25ms'));
|
||||
},
|
||||
};
|
@ -0,0 +1,18 @@
|
||||
{{#if visible}}
|
||||
<div transition:foo></div>
|
||||
{{/if}}
|
||||
|
||||
<script>
|
||||
export default {
|
||||
transitions: {
|
||||
foo() {
|
||||
return {
|
||||
duration: 100,
|
||||
css: t => {
|
||||
return `opacity: ${t}`;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue