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

Updating loading toast is dismissed instantly #201

Closed
simbesh opened this issue Oct 23, 2023 · 3 comments
Closed

Updating loading toast is dismissed instantly #201

simbesh opened this issue Oct 23, 2023 · 3 comments

Comments

@simbesh
Copy link

simbesh commented Oct 23, 2023

When creating a loading toast with duration: infinite, you must pass another duration in the update otherwise the update keeps the infinite duration. I would expect that the default duration should override the loading toasts duration.

However, when passing a new duration for the updated toast, it is not respected and closes instantly. (regardless of value set)

see: https://codesandbox.io/s/xenodochial-grass-jfsdrp?file=/src/App.js

@choeqq
Copy link
Contributor

choeqq commented Oct 24, 2023

what would be an real world example of passing duration: infinite?

@simbesh
Copy link
Author

simbesh commented Oct 25, 2023

Almost all instances where you need to control the loading toasts' state or an event that takes an indeterminate amount of time to complete.
If you don't set duration: infinite the loading toast will auto-close, after the default duration. (which I fail to see a use for)

my usage:

  • long-running requests
  • batch requests, grouped in one toast, updated with progress.

@emilkowalski
Copy link
Owner

This has been fixed in #206

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

3 participants