-
-
Notifications
You must be signed in to change notification settings - Fork 730
Display Toast at the Top Over the Portal-Based Modal. #1220
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
Comments
Same thing facing, is there any fix? Update: I have got my fix. this is my toast showing code
and this is my modal
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I created the Modal as follows using a Portal.
I have declared your toast in the Modal, and similarly, I have also declared it in app.tsx.
I want to display a toast at the top even within a Portal, so I've defined the toast both inside the Portal and in app.tsx.
However, while the toast does appear at the top inside the portal, it fails to execute when I attempt to trigger the toast- displaying logic after closing the portal. Since the portal unmounts, the toast also does not mount.
In other words, while the toast can be displayed on top of either the Portal or app.tsx, there is a challenge in displaying the toast when the parent component unmounts.
Even when the toast is rendered within a portal, it does not appear above the modal created by another portal, and the toast does not persist as expected.
How can I resolve this issue?
The image below shows the state when the toast is not mounted inside the modal defined in the Portal.
The image below shows the toast when declared inside the Modal. However, in this case, it is not possible to display the toast after the modal is closed.
The text was updated successfully, but these errors were encountered: