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

Setting duration does not work as it should #89

Open
IAkumaI opened this issue Sep 14, 2023 · 5 comments
Open

Setting duration does not work as it should #89

IAkumaI opened this issue Sep 14, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@IAkumaI
Copy link

IAkumaI commented Sep 14, 2023

const id = toast.push('message', {duration: 90000});
toast.set(id, {msg: 'another', duration: 3000});

Hello. The code above must change the durations of the toast, but it does not.
As a "fix" - you can hover the toast and the duration will change after and only after the hovering.

Svelte. The latest version.

@zerodevx
Copy link
Owner

Thanks for the report - it's a drawback of the current implementation. What is your expectation though? Does the second statement cause the progress bar to reset (move from 1 to 0) in 3s?

@IAkumaI
Copy link
Author

IAkumaI commented Sep 14, 2023

The expectation was changing of the duration :)
I was showing a toast "Wait..." then I set it to "Success/Failure" and didn't know how to do it right.

Current (and correct) version is:

const id = toast.push('message', {dismissable: false, initial: 0, next: 0, duration: 3000});
toast.set(id, {msg: 'another', dismissable: true, next: 1});

But the bug is still there, so I decided to report it.
The second statement does nothing with the duration. The progress bar didn't react at all until I hovered the toasts. I suppose there are some updates on-hover and it causes the update.

@zerodevx
Copy link
Owner

zerodevx commented Sep 15, 2023

Currently duration is not reactive - I'll fix it add this feature in the next release.

@zerodevx zerodevx added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Sep 15, 2023
@Spimy
Copy link

Spimy commented Apr 28, 2024

Are there any plans for this to be fixed / added soon? It has been a while since this issue was opened.

@zerodevx
Copy link
Owner

zerodevx commented May 6, 2024

Yes, cutting a v1 release is next on my to-do list, once I finish this round of work.

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

No branches or pull requests

3 participants