Toast: component loses its z-index when using "replace"

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

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

評価

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

調査の方向性

components/lib/toast/Toast.js、特に報告で特定されている onExited 関数から始め、リンクされた StackBlitz の例を使って単一メッセージの置換フローを再現します。ダイアログが開いている状態で 1 つのメッセージを置換しても toast の z-index が維持されることを確認し、利用可能であれば関連する Toast テストを実行します。

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

説明

Status: Needs Triage
Describe the bug

Hello, we found an issue where the replace method make the toaster component loose its z-index value when there is a single message being show. When there are no messages or more than 1 it behaves correctly. We can see, inspecting the DOM, the z-index property disappearing from the toast component.

The onExited function is called by the CSS transition component and it clears the z-index:
https://github.com/primefaces/primereact/blob/f2294cc30eb2d13d36a4556159388ea9dde6ecb4/components/lib/toast/Toast.js#L95

Reproducer

https://stackblitz.com/edit/fx59uvcx?file=src%2FApp.jsx

System Information
Browser: Chrome, Firefox
primereact: 10.8.0, 10.9.7
react: 18.3.1
Steps to reproduce the behavior
  1. Click "Show dialog"
  2. Click "Show" once
  3. Click "Replace": the message gets rendered behind the dialog

Note: we get the correct behavior if we click on "Show" multiple times, or clear all messages and use "Replace" once.

Expected behavior

The replacing message is rendered above the dialog.

主要言語
CSS
スター
8.3k
フォーク
1.2k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

primefaces/primereact のほかの issue

primefaces/primereact の issue をすべて見る

似ている issue

Web Dev の issue をもっと見る

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

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