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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading state of a toast isn't removed when using toast() with the same ID of the toast.loading() #401

Open
webdevelukas opened this issue Apr 10, 2024 · 0 comments

Comments

@webdevelukas
Copy link

webdevelukas commented Apr 10, 2024

Describe the feature / bug 馃摑:

If I create a toast with toast.loading('loading', { id: 'test' }) and I later call toast('not loading anymore', { id: 'test' }) which for my expectation should remove the loading state from the toast. It doesn't do that. It just switches the text, but it stays in the loading state. I want to do it like this because I just want to show a "neutral" toast when the loading is finished and I don't want to use a toast.success or something similar because of the styling.

Steps to reproduce the bug 馃攣:

I've tested it in v1.4.0 and the latest v1.4.41

  1. I added two buttons in a Next.js project
 <button type='button' onClick={() => toast.loading('loading', { id: 'test' })}>Set loading</button>
 <button type='button' onClick={() => toast('not loading anymore', { id: 'test' })}>Remove loading</button>
  1. Click the "Set Loading" Button and the toast appears showing the spinner and "loading".
  2. Click the "Remove Loading" Button and the toast is still showing the spinner but with "not loading anymore".
    image
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