Skip to content

Commit

Permalink
Fix #5972: Toast/Message onRemove have the message (#5980)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Feb 15, 2024
1 parent efc4f35 commit 6489ccc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/lib/messages/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const Messages = React.memo(

setMessagesState((prev) => prev.filter((msg) => msg._pId !== messageInfo._pId && !ObjectUtils.deepEquals(msg.message, removeMessage)));

props.onRemove && props.onRemove(removeMessage);
props.onRemove && props.onRemove(removeMessage.message || removeMessage);
};

const onClose = (messageInfo) => {
Expand Down
2 changes: 1 addition & 1 deletion components/lib/toast/Toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const Toast = React.memo(

setMessagesState((prev) => prev.filter((msg) => msg._pId !== messageInfo._pId && !ObjectUtils.deepEquals(msg.message, removeMessage)));

props.onRemove && props.onRemove(removeMessage);
props.onRemove && props.onRemove(removeMessage.message || removeMessage);
};

const onClose = (messageInfo) => {
Expand Down
1 change: 1 addition & 0 deletions components/lib/toast/ToastBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const ToastBase = ComponentBase.extend({
__TYPE: 'Toast',
id: null,
className: null,
content: null,
style: null,
baseZIndex: 0,
position: 'top-right',
Expand Down

0 comments on commit 6489ccc

Please sign in to comment.