sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
77.43k stars 4.03k forks source link

Low quality animation example #12161

Closed KevinDoughty closed 12 minutes ago

KevinDoughty commented 1 week ago

Describe the bug

The animation example at https://svelte.dev/examples/animate is of low quality and fails on double and triple click. Personally, I think non-additive FLIP is bollocks and a bigger problem, but I'm not going to tell you how to animate like I tried to tell Apple and the W3C.

Reproduction

Click rapidly, as seen in the following video: https://x.com/KvnDy/status/1805192958259433800 https://fosstodon.org/@kvndy/112671224307964439

Logs

No response

System Info

The video was recorded using Brave browser but I don’t think it matters.

Severity

annoyance

KevinDoughty commented 1 week ago

Also happens using Firefox

7nik commented 1 week ago

Steps to reproduce:

  1. add duration: 3000 to the animations;
  2. click any element to start the animation;
  3. click the flying element again.

After a lot of clicking, I got this as the final state of elements:

image

However, I wonder how often it happens in real life.

KevinDoughty commented 1 week ago

If it’s good enough for Svelte, fine. I intend to animate on key events or incoming data and will be forced to seek alternative techniques.

KevinDoughty commented 1 week ago

However, I wonder how often it happens in real life.

Ship it!

khromov commented 1 week ago

A possible workaround could be to add pointer-events:none; during the transition, which should prevent the box from being clickable during animation.

Prinzhorn commented 1 week ago

https://github.com/sveltejs/svelte/issues/6562

KevinDoughty commented 12 minutes ago

Dupe, closing in favor of https://github.com/sveltejs/svelte/issues/6562