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

Aperta
#8,403 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
57/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript, react
Ambito
frontend

Direzione di ricerca

Inizia da components/lib/toast/Toast.js, in particolare dalla funzione onExited identificata nel report, quindi riproduci il flusso di sostituzione di un singolo messaggio usando l’esempio StackBlitz collegato. Conferma che lo z-index del toast rimanga presente quando si sostituisce un messaggio mentre è aperto un dialog, ed esegui i test Toast pertinenti, se disponibili.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
CSS
Stelle
8.3k
Fork
1.2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di primefaces/primereact

Tutte le issue di primefaces/primereact

Issue simili

Altre issue su Web Dev

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.