ToastType doesn't apply classes to regular Toast, only the SimpleToast

Abierto
#1,215 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
csharp
Área
frontend

Línea de trabajo

The issue identifies the class assignment in the regular Toast component and compares it with the SimpleToast assignment; it does not name file paths or tests. Start by locating both components and comparing how each builds its classes from ToastMessage.Type. Done means regular toasts display the color classes for their ToastType, matching the expected behavior in the report.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Describe the bug
It appears the regular Toast (with title and helptext) does not apply the color classes to the toast.
The SimpleToast however does pop up perfectly with a red background when set to danger.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a ToastComponent
  2. Trigger a ToastService.Notify(new(ToastType.Danger, "SimpleToast Danger Color" ))
  3. Trigger a ToastService.Notify(new(ToastType.Danger, "", "Toast", "HelpText", "regular 'Toast' Danger Color", false ))
  4. Notice the color is not applied to the second toast.

Expected behavior
Both toast types to be styled to match the ToastType.

Screenshots
Image

Versions (please complete the following information):

  • .NET Version: .NET 10
  • BlazorBootstrap: 3.5.0
  • Blazor WebAssembly / Server: Server
  • Blazor Interactive Render Mode: interactiveserver for Toast component
  • Blazor Interactivity Location: page/component

Sample code

InvokeAsync(() => ToastService.Notify(new(ToastType.Success, "", "Toast", "HelpText", "Can't read this", false )));

Additional context

Little deeper dive reveals that in the simple toast we find this for the class assignment which looks correct:
On line 20:

protected override string? ClassNames => BlazorBootstrapComponentBase.BuildClassNames(base.Class, ("toast", true), (ToastMessage.Type.ToToastTextColorClass(), ToastMessage != null), (ToastMessage.Type.ToToastBackgroundColorClass(), ToastMessage != null));

but in the regular toast we find this:
On line 28:

protected override string? ClassNames => BlazorBootstrapComponentBase.BuildClassNames(base.Class, ("toast", true));

Perhaps I'm misunderstanding something, but I suspect it might be a bug.

Lenguaje dominante
HTML
Estrellas
1.2k
Forks
111
Merge medio
4 min
PR fusionados (30 d)
55

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vikramlearning/blazorbootstrap

Todos los issues de vikramlearning/blazorbootstrap

Issues similares

Más issues de Web Dev

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.