-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 and message onRemove argument is not a ToastMessage type when it has _pId #6784
Toast and message onRemove argument is not a ToastMessage type when it has _pId #6784
Comments
Agreed you should be able to do this... toastRef.current.remove({ id: messageId }); but that is not working. |
My main issue is I don't know what to do with the _pId, as I have all the information in my process stored on the ToastMessage, and also receiving two distinct arguments in the same function is some sort of... messy |
@lukelalo here is a demo i did for another user that works but it requires you to keep the message to remove it. |
Yep, but this demo doesn't use the |
yeah your issue is definitely a bug. |
Hi, I also experimenting a bug due to this issue. Only at first interaction with close, the argument passed to the remove function is the entire message object instead of a pId, which cause the remove of all messages which are the same. From the second interaction the argument is a pId and the close action works correctly, only the specific message with that pId is removed. |
Similar to #5972 |
* Fixed toast onRemove message * Fixed Messages.js onRemove message --------- Co-authored-by: pablo.garcia.almis <[email protected]>
Describe the bug
Hi,
I've seen some changes in toast/message code and I think these changes may have broken the onRemove call parameters:
In the first call to onRemove it may not have the ._pId attribute, but in the second call it has it, and instead of sending the ToastMessage in onRemove function it returns the _pId.
I think the onRemove call should be called with
messageInfo.message || messageInfo
instead ofremoveMessage
.Regards
Pablo García
Reproducer
No response
PrimeReact version
10.6.6
React version
17.x
Language
ES6
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
The text was updated successfully, but these errors were encountered: