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
I have modal form, which in case can open another modal form (to add a new object and save the returned ID from the server). I am using sveltekit-superforms. When the form action is submitted and response arrives, the sveltekit's applyAction is called (https://svelte.dev/docs/kit/form-actions#Progressive-enhancement-Customising-use:enhance). This causes all of open dialogs to close (property open is set to false).
The warning is not directly relevant to the issue, but helped to nail down the issue. I tried disabling the execution of applyAction in sveltekit-superforms - after that Modals do not get closed, unless I close them (programmatically).
Expected Behavior
I guess the applyAction (form actions) should not have such effect on the Modal.
Steps To Reproduce
Open modal dialog with form (sveltekit-superforms) and submit with success.
Link to Reproduction / Stackblitz
No response
More Information
No response
The text was updated successfully, but these errors were encountered:
Hey @ktarmyshov not sure how much we do can here. If you're using use:enhanced that's supposed to prevent a page refresh, which would definitely flush all ephemeral state such as modals. I'm not really sure the mechanics of SvelteKit forms, especially with third party tooling like Superform in the mix.
That said, the creator of SuperForms (Cisco) is extremely friendly and does a great job with support. You might consider opening a similar ticket on their side, and/or reaching out in their Discord. They tend to be very active like us.
I can almost promise they'll be able to look into this sooner than we can, but provide better insight into the mechanics happening under the hood during form submission. Keep in mind that our current Svelte-only popover modals are functionally very similar to the native <dialog> or <popover> elements. Both of which would likely suffer from the exact same issue.
You might reference that when explaining the issue so it's clear exactly what's happening, which is: on submission the element and/or component state within forms is being reset.
Current Behavior
I have modal form, which in case can open another modal form (to add a new object and save the returned ID from the server). I am using sveltekit-superforms. When the form action is submitted and response arrives, the sveltekit's applyAction is called (https://svelte.dev/docs/kit/form-actions#Progressive-enhancement-Customising-use:enhance). This causes all of open dialogs to close (property open is set to false).
The warning is not directly relevant to the issue, but helped to nail down the issue. I tried disabling the execution of applyAction in sveltekit-superforms - after that Modals do not get closed, unless I close them (programmatically).
Expected Behavior
I guess the applyAction (form actions) should not have such effect on the Modal.
Steps To Reproduce
Open modal dialog with form (sveltekit-superforms) and submit with success.
Link to Reproduction / Stackblitz
No response
More Information
No response
The text was updated successfully, but these errors were encountered: