Blazored / Toast

A JavaScript free toast library for Blazor and Razor Component applications
https://blazored.github.io/Toast/
MIT License
663 stars 92 forks source link

[Bug] Additional Classes for Warning / Info / Success / etc. Toasts are no longer applied #221

Closed taylorchasewhite closed 1 year ago

taylorchasewhite commented 1 year ago

Describe the bug Using the WarningClass, InfoClass, ErrorClass, and SuccessClass no longer applies the specified classes to the toast.

To Reproduce Steps to reproduce the behavior:

  1. In MainLayout.razor (or wherever BlazoredToasts is consumed), use custom classes for your toasts:
    <BlazoredToasts Position="ToastPosition.BottomRight"
                ErrorClass="alert alert-danger"
                ErrorIcon="fas fa-times-circle"
                SuccessClass="alert alert-success"
                SuccessIcon="fas fa-check"
                WarningClass="alert alert-warning"
                WarningIcon="fas fa-exclamation-triangle"
                InfoClass="alert alert-info"
                IconType="Blazored.Toast.Configuration.IconType.FontAwesome" />
  2. Launch a toast and see the class(es) no longer are applied.

Expected behavior Append the specified string in WarningClass (and others) to the rendered BlazoredToast component's class list (e.g. apply to ToastSettings object).

Hosting Model (is this issue happening with a certain hosting model?): All hosting models.

Additional context It looks like this happened in #181 in commit 2a3eaa4 where we changed the ToastSettings initializer to be multi-line, the additional class logic was dropped.

taylorchasewhite commented 1 year ago

@chrissainty If this is as straightforward as returning that (presumably) inadvertently removed logic, I'd be happy to take a stab at it and open a PR!

JeremySayers commented 1 year ago

Also ran into this tonight using the latest version.

taylorchasewhite commented 1 year ago

@JeremySayers, I decided to go ahead and stick with updating my packages. To get around this issue until #222 gets merged in I just added more specific styles to the default classes applied. Here are the class names: