Skip to content

Transition delay is cached and does not apply until after the next run #5953

@GrygrFlzr

Description

@GrygrFlzr

Describe the bug
After a transition has already been triggered, changing the delay of a transition does not take effect until after the transition has been triggered at least once.

To Reproduce
REPL: https://svelte.dev/repl/48114260160b40d7bcb2f0d2dc148eb6?version=3.38.3

  1. Click Menu several times to toggle the default transition.
    IMPORTANT: The bug requires triggering the transition at least once before the delay is cached.
  2. Click Set Delay to 1s, the delay variable is now set to 1000.
  3. Click Menu to toggle the transition, delay has not taken effect.
  4. Click Menu to toggle the transition, delay now takes effect.
  5. Click Set Delay to 0, the delay variable is now set to 0.
  6. Click Menu to toggle the transition, 1s delay still applies.
  7. Click Menu to toggle the transition, delay is now updated.

Expected behavior
I expect the delay to apply immediately, or at least applied after I do await tick().

Information about your Svelte project:
Svelte: 3.32.1, 3.38.3
Tested Browsers:

  • Edge: Chromium (88.0.705.50)
  • Chrome: 88.0.4324.104
  • Firefox Dev: 86.0b5 (64-bit)

Severity
Low

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