mirror of https://github.com/sveltejs/svelte
apply t0 styles to nodes if css transition has delay. fixes #574
parent
bf78dcc86a
commit
b831d6c47f
@ -0,0 +1,12 @@
|
||||
export default {
|
||||
test ( assert, component, target, window, raf ) {
|
||||
component.set({ visible: true });
|
||||
const div = target.querySelector( 'div' );
|
||||
assert.strictEqual( div.style.opacity, '0' );
|
||||
|
||||
raf.tick( 50 );
|
||||
assert.strictEqual( div.style.opacity, '' );
|
||||
|
||||
component.destroy();
|
||||
}
|
||||
};
|
@ -0,0 +1,19 @@
|
||||
{{#if visible}}
|
||||
<div transition:foo>delayed</div>
|
||||
{{/if}}
|
||||
|
||||
<script>
|
||||
export default {
|
||||
transitions: {
|
||||
foo: function ( node, params ) {
|
||||
return {
|
||||
delay: 50,
|
||||
duration: 100,
|
||||
css: t => {
|
||||
return `opacity: ${t}`;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue