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

オープン
#1,215 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
csharp
領域
frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
HTML
スター
1.2k
フォーク
111
平均マージ
4分
マージ済み PR(30日)
55

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vikramlearning/blazorbootstrap のほかの issue

vikramlearning/blazorbootstrap の issue をすべて見る

似ている issue

Web Dev の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。