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

Add id to toast, auto overriding previous toast with same id #14

Closed
Tucsky opened this issue Apr 19, 2020 · 4 comments
Closed

Add id to toast, auto overriding previous toast with same id #14

Tucsky opened this issue Apr 19, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@Tucsky
Copy link

Tucsky commented Apr 19, 2020

Hello, thank you for this plugin, it is very light and get the job done quick.
I have one suggestion sir.

Its very common for web app to have recurrent messages (shown as toast), like errors occuring for the same reason (or related to), or steps in the app workflow that shows a toast for each step but it would be less overwhelming to override the previous toast if step get finished fast. Because it is related.

I would suggest to add an "id" property to the toast, optional of course, but if it is set and a toast already exists with the same id, immediately hide this previous toast and show new one.

I could try a PR if you agree that it could be a good addition.

@ankurk91
Copy link
Owner

@Tucsky
Hi, thanks for the idea, yes you can try to send a PR, i would like to see your implementation first.
I would also like to see any existing similar toast plugin which does the same.

@ankurk91 ankurk91 added the enhancement New feature or request label Apr 19, 2020
@Tucsky
Copy link
Author

Tucsky commented Apr 19, 2020

Well there was two plugin that pop out when I decided to add one to my app, vue-toasted and this one! I didn't actually checked to see if vue-toasted was doing the id feature before posting but just found out that it don't support that, which is surprising tbh.

Anyway, there you go, its for react but its doing the id thing https://github.com/fkhadra/react-toastify#use-a-custom-id

Imma try the pr then 👍

@ankurk91
Copy link
Owner

I will check in my day, thanks.

@ankurk91
Copy link
Owner

Follow #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants