Skip to content

animate directive with duration:0 should be completely disabled / Programmatically disable animate directive #7889

Closed
@JuanDouek

Description

@JuanDouek

Describe the problem

When using animate directive I want to be able to programmatically disable it.
Using duration:0 or even swapping the animate function with an empty one does not completely disable it:

import { flip } from 'svelte/animate';
$: Flip = animate? flip : () => { return {}}; // tried with null / undefined with no luck

You can see in the video that, when using these strategies, there is still something going on that produces a jump when scrolling.

svelte.animate.mov

Describe the proposed solution

Completely disable animate directive when there is no animation to play.

Alternatives considered

Allow animate:null or animate:undefined

Importance

nice to have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions