ModalProvider unmounts previous modals #4023
testerez
started this conversation in
Feature requests
Replies: 1 comment 2 replies
-
Hey @rtivital , is there any chance to see this change implemented? Otherwise I may code my own modal provider so that I can stack modals without loosing state. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What package has an issue
@mantine/modals
Describe the bug
I noticed that
ModalProvider
only keeps the currently visible modal mounted. This can be an issue when you open a modal from another one. For example if you display a form in a modal and want to open a confirmation modal on top of it. In that case, the state of the form is lost. See my sandbox link for a self contained example.What version of @mantine/hooks page do you have in package.json?
6.0.6
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/s/agitated-microservice-bt1k2f?file=/src/App.tsx
Do you know how to fix the issue
None
Are you willing to participate in fixing this issue and create a pull request with the fix
Yes
Possible fix
It would be nice if
ModalProvider
could keep all opened modals mounted so that we can stack them without loosing the components state.Beta Was this translation helpful? Give feedback.
All reactions