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

Feature request: Close button #91

Open
aljaznuncic opened this issue Jul 12, 2024 · 4 comments
Open

Feature request: Close button #91

aljaznuncic opened this issue Jul 12, 2024 · 4 comments

Comments

@aljaznuncic
Copy link

I'm submitting a ...

[ ] Bug report => search github for a similar issue or PR before submitting
[x] Feature request
[ ] Other, please describe

Tell about your platform

  • Vue.js version : 3.4.21
  • This package version : 3.1.2

Expected behavior

Additional option for close button would be very welcome:

  • showCloseBtn - an 'X' appears in the upper right corner of the toast notification to close it. Than you can set dismissible to false and still allow the user to close the toast by clicking this close button. This would be very useful when you want to add a button to the toast notification and avoid accidental closing (e.g. touch screen).
@ankurk91
Copy link
Owner

ankurk91 commented Jul 12, 2024

You can still click on toast to close

@aljaznuncic
Copy link
Author

I know, but I would like the functionality of the close button for two reasons:

  1. In some notifications I will have actions with links and I would like to avoid that the user accidentally closes the notification instead of clicking the action (especially mobile devices with touch screens).
  2. I would have two types of notifications in the app, one that would automatically disappear after a certain amount of time, and one that would need manual closing from the user (more important notifications). In order for the user to separate them faster, a close button would be very convenient. This way, the user would immediately know that he/she has to close this notification manually.

I hope the extra close button isn't a lot of extra work.

@ankurk91 ankurk91 changed the title Close button Feature request: Close button Jul 13, 2024
@braincomb
Copy link

+1 for this feature request.

This would be especially helpful if a toast is set to 0 duration (persisted), so an "X" would indicate that it is interactable and dismissable.

Perhaps it could be a configurable option whether to display the close button or not.

@bruno-azenha
Copy link

+1 for this feature request.

My use case is exactly as @braincomb's. I'm also setting the duration to 0 and would like to give my customers the very clear understanding that by clicking on the toast they can dismiss it.

I'd just like a close button to be visible even if clicking anywhere on the toast would dismiss it.
Thanks for the great work!

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

4 participants