-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
Feat: Limit the number of toast displayed at the same time #298
Comments
Hello @popugang, You can already pass a component and limit the output. For instance, lets do it with css and a functional component. .limited-output{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 200px;
} // somewhere in your app
toast(() => (
<div className="limited-output">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt rem odit quis quaerat. In dolorem
praesentium velit ea esse consequuntur cum fugit sequi voluptas ut possimus voluptatibus deserunt
nisi eveniet!Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem voluptates vel dolorum
autem ex repudiandae iste quasi. Minima explicabo qui necessitatibus porro nihil aliquid deleniti ullam
repudiandae
</div>
); You can find more about rendering a component here |
@fkhadra You do not understand me. I want to limit the notification showing. |
Hello @popugang, You mean limit the number of toast displayed at the same time ? |
exactly |
@fkhadra what can do with it ? |
@fkhadra reopen issue please |
@fkhadra thank you very much |
Will be cool to have a buffer that will store delayed notifications until we can show them |
It would be awesome if this is available as an option in the toast container |
@fkhadra Any progress on that so far? Maybe, you would need additional help? |
I need this feature too, to me it would be super cool to have n toasters and having the old ones to close automatically as the new ones appear! |
I also need this feature |
I would love such a feature as well. Have to handle this myself for now. |
I faced same issue |
Hello guys, I'm rewriting the library, maybe I'll port it to typescript. The goal is to reduce the bundle size and also to lower the barrier for newcomers. I'll see how to add this feature. |
also i need this feature |
also i need this feature |
+1; I'd love to have a |
Hey, a v6 release candidate is available including that feature. You can try it here |
@fkhadra great release, thank you so much. I have a scenario that need to display the latest limited toasts, and hide the oldest toasts, as my site need to push the latest real-time messages to users, queued toasts may delay some important informations... is it necessary support 2 modes for count limit? LRU and Queued? |
@zslucky the v6(not RC) is now live. Maybe this can help https://fkhadra.github.io/react-toastify/limit-the-number-of-toast-displayed/#how-to-clear-the-waiting-queue |
@fkhadra thanks, this can be a solution. 👍 |
Do we, maybe, have access to that queue. I am interested in a number of notifications in queue. Or, and I know this is not the topic, can we get number of currently displayed notifications. For example, I would like to display "dismiss all" button inside notification only when there are more than 3 notifications displayed (have searched for this feature but haven't found it, apologies if it exists, in that case plz point me in the right direction). |
I'm not using the ToastContainer but there doesn't seem a way to set the limit property programmatically. Will this be added? Also, a 'dismiss all' button would be nice as mentioned above |
Do you want to request a feature or report a bug?
feature
What is the current behavior?
No limited on showing
What is the expected behavior?
Props to limited toast showing
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React v16.7
The text was updated successfully, but these errors were encountered: