[Popover/Modal] Losing form state inside modal/popovers
See original GitHub issueHi there!
I’m not sure if this is an issue with popovers/modals being “removed” from the DOM vs hidden using CSS but I have a form inside a popover component and when the popover is closed and reopened, the form state inside is lost.
Apologies if this is something outside the scope here but it would appear that somehow the component is re-rendering and then perhaps losing state.
The Form is using react-hook-form
in case that is of any relevance.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to have a form in a modal behind a popover menu action
Had a similar situation but with the overlay over a modal. The answer was to use enforceModal prop to remove focus from the...
Read more >ion-popover - Ionic Framework
ion-popover is a dialog that appears on top of the current page. Learn about the popover UI component and CSS custom properties for...
Read more >JavaScript · Bootstrap
modal -backdrop to provide a click area for dismissing shown modals when clicking outside the modal. Via data attributes. Activate a modal without...
Read more >Popover | Components - BootstrapVue
The Popover feature provides a tooltip-like behavior, can be easily applied to any interactive element via the component or v-b-popover directive.
Read more >useOverlayTrigger – React Aria - React Spectrum Libraries
Note: useModal only hides content within parent OverlayProvider components. However, if you have additional content in your application outside any ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @andregoldstein,
You’re right, this is because the Popover gets removed from the DOM. We’ve fixed this to use the
hidden
attribute so it remains in the DOM. As for the modal, we think it’s best to mount/unmount it from the DOM.The fix is available in the
v1.0.0-next.3
pre-release. We’re trying to getv1
out as fast as possible so you can start using it.Cheers.
@with-heart Hello! Thanks, will do!