You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] bug report
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57
I'd like to propose a new method for the <Messages /> component to replace messages already being showed.
Imagine you are currently showing 3 messages and you then want to show 2 different messages instead. It is not possible to first do clear() and then immediately do show() because of setState being asynchronous. You can see this here: https://codesandbox.io/s/primereact-test-1t723
By first clearing messages with setState and then
provide a callback to set new messages we ensure
that the state has been updated before we try
to add new messages that are to replace existing
ones.
Fixesprimefaces#930
I'm submitting a ... (check one with "x")
I'd like to propose a new method for the
<Messages />
component to replace messages already being showed.Imagine you are currently showing 3 messages and you then want to show 2 different messages instead. It is not possible to first do
clear()
and then immediately doshow()
because ofsetState
being asynchronous. You can see this here:https://codesandbox.io/s/primereact-test-1t723
Here it is with a method that works as the new messages are shown once the state change has already happened:
https://codesandbox.io/s/primereact-test-9uh86
I'll create a PR for it and hope you will approve.
The text was updated successfully, but these errors were encountered: