Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing state of a toast using id don't have animations #109

Open
CNSeniorious000 opened this issue Jun 28, 2024 · 1 comment
Open

Changing state of a toast using id don't have animations #109

CNSeniorious000 opened this issue Jun 28, 2024 · 1 comment

Comments

@CNSeniorious000
Copy link

CNSeniorious000 commented Jun 28, 2024

Describe the bug

If I use toast.promise, when it changes from loading state to success/error state, it has a smooth scale-in-out animation, and the background color is fade-in-out too.

But if I use id to set an existing toast with loading state to success or others, it is not animated.

Reproduction

https://stackblitz.com/edit/vitejs-vite-dfaa5m?file=src%2FApp.svelte

Logs

No response

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
    Memory: 1.56 GB / 15.18 GB
  Binaries:
    Node: 20.9.0 - D:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Local\pnpm\yarn.CMD
    npm: 10.8.1 - D:\Program Files\nodejs\npm.CMD
    pnpm: 9.4.0 - ~\AppData\Local\pnpm\pnpm.CMD
    bun: 1.1.13 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (126.0.2592.68)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @sveltejs/kit: ^2.5.17 => 2.5.17
    svelte: ^4.2.18 => 4.2.18
    svelte-sonner: 0.3.24 => 0.3.24

Severity

annoyance

@CNSeniorious000 CNSeniorious000 changed the title Changing state of a toast don't animate the icon Changing state of a toast using id don't have animations Jun 28, 2024
@CNSeniorious000
Copy link
Author

After reading the source in state.ts, I found that adding a promise: true to the options can make it animate like toast.promise do. I am thinking whether this can become a default behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant