-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Inability to update toast duration
dynamically
#529
Comments
I believe using |
This is good but I don't think it's the same. If you look at my example above, it's hard to achieve this level of granularity with the |
I have also encountered such a problem |
This probably meets the needs, but it would be even better if the const id = toast.info('Preparing download...', {
duration: Infinity,
})
try {
await downloadFile('https://......mp4', undefined, {
onProgress(event) {
const progress = Math.floor((event.loaded / event.total) * 100)
toast.info(`Downloading... ${progress}%`, {
id,
})
},
})
toast.info('Download complete 🎉', {
id,
})
} catch (error) {
toast.info('Download failed 😭', {
id,
})
}
setTimeout(() => {
toast.dismiss(id)
}, 3000) |
Inability to update toast duration dynamically closed emilkowalski#529
This issue was previously reported in #509 but appears to have been closed prematurely. I believe this is still a valid problem that warrants further investigation.
Expected Behavior
The
duration
of a toast should be updatable after it has been displayed. This is a fairly common use case, especially when providing feedback for async operations such as API calls.Use Case
duration
(or infinite) while an API call is being made.Example Code
Why This Matters
The ability to dynamically update a toast’s duration enhances user experience by providing timely, context-sensitive feedback.
The text was updated successfully, but these errors were encountered: