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: onRemove's message changes its data structure #5972

Closed
yunics-highfield opened this issue Feb 15, 2024 · 2 comments · Fixed by #5980
Closed

Toast: onRemove's message changes its data structure #5972

yunics-highfield opened this issue Feb 15, 2024 · 2 comments · Fixed by #5980
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@yunics-highfield
Copy link

Describe the bug

OnRemove's first parameter is message: ToastMessage. But onRemove doesn't give ToastMessage when you remove a first toast.

Reproducer

https://stackblitz.com/edit/stackblitz-starters-73nt13?file=src%2FApp.js

PrimeReact version

10.5.0

React version

18.x

Language

ES5

Build / Runtime

Create React App (CRA)

Browser(s)

Chrome Version 121.0.6167.184 (Official Build) (arm64)

Steps to reproduce the behavior

  1. Go to the reproducer.
  2. Click the "Show a toast" button twice.
  3. Wait for removing the toasts.
  4. Check the console.

Expected behavior

onRemove's first parameter (message) should be ToastMessage.

@yunics-highfield yunics-highfield added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 15, 2024
@melloware
Copy link
Member

Yes the comment says this...

// allow removal by ID or by message equality
const removeMessage = messageInfo._pId ? messageInfo.message : messageInfo;

@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 15, 2024
@melloware melloware self-assigned this Feb 15, 2024
@melloware melloware added this to the 10.5.2 milestone Feb 15, 2024
melloware added a commit to melloware/primereact that referenced this issue Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants