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] I want to set the global timeout per toast type, in addition to the current setting for all types, for a better user experience. #239

Open
szalapski opened this issue Nov 16, 2023 · 3 comments
Labels
Feature Request Request to add a new feature Needs: More Information The author needs to provide more information on the issue.

Comments

@szalapski
Copy link

Is your feature request related to a problem? Please describe.
My users don't want "Success" toasts cluttering up the screen for very long, yet they want errors and warnings to show for a longer time so that they can read the message.

Describe the solution you'd like
I'd like to be able to set the timeout duration independently and optionally for Success, Info, Warning, and Error, in addition to the global timeout duration. Obviously, if any of these is set, it would override the global timeout duration.

Describe alternatives you've considered
I could use the settings lambda to set a custom timeout on every one of hundreds of .ShowSuccess calls, but that doesn't seem wise.

@szalapski szalapski added Feature Request Request to add a new feature Triage Issue needs to be triaged labels Nov 16, 2023
@szalapski szalapski changed the title [Feature Request] I want to set the global timeout per toast type, rather than only for all toasts Nov 16, 2023
@szalapski szalapski changed the title [Feature Request] I want to set the global timeout per toast type, in addition to the current setting for all types. Nov 16, 2023
@chrissainty
Copy link
Member

@szalapski Apologies for taking so long to reply. Have you tried the pause on hover feature? It would allow your users to hover over any toast they want to keep on the screen and it will only be removed when they move their cursor away from it.

@chrissainty chrissainty added Needs: More Information The author needs to provide more information on the issue. and removed Triage Issue needs to be triaged labels Feb 19, 2024
@szalapski
Copy link
Author

szalapski commented Feb 19, 2024

My users don't often hover and I'm not sure we could train them to do so. For now I've added lots of custom timeouts. Thanks for the response! ☺️

@stofte
Copy link

stofte commented Mar 15, 2024

I came here looking for the same thing. Wrapping ToastService seems like a simple enough solution. You can easily add in other type specific settings this way as well. I just need the disabled timeout for errors for now.

public class ToastHelper
{
    private readonly IToastService toastService;

    public ToastHelper(IToastService toastService) => this.toastService = toastService;

    public void ShowError(string msg) => toastService.ShowError(msg, (opts) => opts.DisableTimeout = true);

    public void ShowSuccess(string msg) => toastService.ShowSuccess(msg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Request to add a new feature Needs: More Information The author needs to provide more information on the issue.
3 participants