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

how to dismiss immediately without animation? #1098

Open
12343954 opened this issue Apr 7, 2024 · 5 comments
Open

how to dismiss immediately without animation? #1098

12343954 opened this issue Apr 7, 2024 · 5 comments

Comments

@12343954
Copy link

12343954 commented Apr 7, 2024

 "react-toastify": "^4.5.2",
@17LingShan
Copy link

I think you can custom a style when the Transition exit.
See the .no-animation in style.css file.
https://codesandbox.io/p/sandbox/react-toastify-animate-css-forked-j8xdky?file=%2Fsrc%2FApp.js%3A19%2C1

@12343954
Copy link
Author

the reason I do this is because the second and first toast will take up too much view space, so I have to quickly turn off the previous toast without animation so that the second toast takes up the first position and space.

my temporary approach is to remove the previous toast directly from DOM tree before the second toast show up.

avoid occluding more view space.

@17LingShan
Copy link

the reason I do this is because the second and first toast will take up too much view space, so I have to quickly turn off the previous toast without animation so that the second toast takes up the first position and space.

my temporary approach is to remove the previous toast directly from DOM tree before the second toast show up.

avoid occluding more view space.

Okay, I understand what you are meaning. You hope the action of toast is dismissing the oldest toast and adding the newest toast into the container of toasts which has limit prop, right?

@12343954
Copy link
Author

good, your idea is better. limit={1}

something like this.
remove the dismiss animation and keep the displayed animation

Record_2024_04_20_10_47_29_525.mp4

@17LingShan
Copy link

good, your idea is better. limit={1}

something like this. remove the dismiss animation and keep the displayed animation

Record_2024_04_20_10_47_29_525.mp4

It is my pleasure to help you achieve success. 😄

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

2 participants