scale transition duration by delta - fixes #1221

pull/1239/head
Rich Harris 7 years ago
parent 0ac77019d0
commit 140e2271f7

@ -106,7 +106,7 @@ export function wrapTransition(component, node, fn, params, intro, outgroup) {
// when introing, discard old animations if there are any
return anim && (program.delta < 0 || !/__svelte/.test(anim));
})
.concat(program.name + ' ' + duration + 'ms linear 1 forwards')
.concat(program.name + ' ' + program.duration + 'ms linear 1 forwards')
.join(', ');
}

@ -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…
Cancel
Save