Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toast: Toasts with the exact same data/life turn off at the same time #6261

Closed
jimduchek opened this issue Mar 30, 2024 · 3 comments
Closed
Labels
Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team

Comments

@jimduchek
Copy link

Describe the bug

If the exact same 'message'/content/life, all Toasts disappear at the same time. Appears to work correctly in PrimeReact 9. A quick 'workaround' is just adding 1 ms to each consecutive call or changing the content/message. This is, I think, not a high-priority 'bug' but perhaps just a note needed in documentation, as I think while having multiples of the exact same notification is not going to be common in 'real life', it is going to be common in testing, and I spent quite a while chasing this unnecessarily because they "weren't working right".

Reproducer

https://stackblitz.com/edit/vitejs-vite-ds1zfd?file=src%2FApp.tsx

PrimeReact version

10.6.2

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

latest chrome, latest Firefox

Steps to reproduce the behavior

  1. Go to stackblitz link.
  2. Click "Click me ignoring idea folder #1" several times.
  3. Observe: when the first Toast disappears, they ALL disappear.

Expected behavior

  1. Go to stackblitz link.
  2. Click "Click me About defaultProps and propTypes #2" several times.
  3. Observe: Each toast stays on screen for it's own separate life of ~3s.
@jimduchek jimduchek added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 30, 2024
@melloware
Copy link
Member

Yes that is why the Toast mutliple example here: https://primereact.org/toast/#multiple

delays them by 50ms.

const showMultiple = () => {
        toast.current.show([
            { severity: 'success', summary: 'Success', detail: 'Message Content', life: 3000 },
            { severity: 'info', summary: 'Info', detail: 'Message Content', life: 3050 },
            { severity: 'warn', summary: 'Warning', detail: 'Message Content', life: 3100 },
            { severity: 'error', summary: 'Error', detail: 'Message Content', life: 3150 }
        ]);
    };

@melloware melloware added Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Mar 30, 2024
@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2024
@jimduchek
Copy link
Author

As I said, perhaps not a bug but a documentation issue?

@melloware
Copy link
Member

Agreed but its documented in the showcase that way? Were you thinking of something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team
Projects
None yet
Development

No branches or pull requests

2 participants