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

Recreate Toast after hiding using toastId #483

Closed
theMasix opened this issue May 29, 2020 · 3 comments
Closed

Recreate Toast after hiding using toastId #483

theMasix opened this issue May 29, 2020 · 3 comments
Labels

Comments

@theMasix
Copy link

theMasix commented May 29, 2020

Hello. Thanks for great library.

I have an issue and don't know how to fix it.
I assumed that the toastId prevent toast to being duplicate while there is available toast currently.
But I took some tests and understood the toastId prevent duplicate toast even the previous toast which has same toastId isn't be shown currently.
So I wanna prevent duplication only if there is an available toast and if there isn't, I wanna show it again!
how could I do it?
My toastIds are some numbers.(200, 201 etc)

@fkhadra
Copy link
Owner

fkhadra commented Aug 3, 2020

Hey thank you.

You should be able to reuse the same toast id. Could you provide a codesanbodx witht the issue ?

@gajjarnirmal0
Copy link

gajjarnirmal0 commented Sep 30, 2020

I have provided sample code codesandbox.

When you login (admin, adm) and press enter it creates notification with "Internal Server Error.".
But this works sometimes and sometimes it doesn't.

Also check console.log on login.js:96 logs every time
console.log("MAIN_ERROR_MESSAGE", this.props.errors.message);

As per above discussion the notification should be shown again when notification with same toastId disappears and enter is pressed.

@fkhadra
Copy link
Owner

fkhadra commented Oct 5, 2020

It looks like there is a race condition somewhere.

fkhadra added a commit that referenced this issue Dec 29, 2020
@fkhadra fkhadra added the Merged in next Merged but not live label Dec 29, 2020
@fkhadra fkhadra mentioned this issue Dec 29, 2020
fkhadra added a commit that referenced this issue Jan 25, 2021
## 💥 Breaking changes

- dependency to react-transition-group has been removed #514
- the `duration` parameter has been removed from `cssTransition`. Css animations just works now out of the box. Check the codesanbox below  
- the border-radius has been increased a bit

##  🚀 Features

- Css animation just works! 
[![View](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-toastify-animatecss-jxrx9?fontsize=14&hidenavigation=1&theme=dark&view=preview)

- add a way to load the CSS without a CSS loader
[![Edit react-toastify-inject-style](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-toastify-inject-style-qfg0l?fontsize=14&hidenavigation=1&theme=dark)
- specify swipe direction, close #512 . Thanks to @denydavy
[![Edit react-toastify-drag-y](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-toastify-drag-y-lh88i?fontsize=14&hidenavigation=1&theme=dark)
- bundle size reduced from ~7k to ~5k!
- remove the dependency on prop-types.

## 🐛 Bugfix

- fix #541 apply pauseOnFocusLoss on first render
- fix #538 react-dom should be a peer dep
- fix #530 change id generation
- fix #534 #483 toastId cannot be reused
- fix #511 by removing react-transition-group
- fix #550 Unable to select text inside inputs when a toast is open
- fix #555 The toast timer starts after you click on the toast
@fkhadra fkhadra closed this as completed Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants