flekschas / svelte-simple-modal

A simple, small, and content-agnostic modal for Svelte v3 and v4

Home Page:https://svelte.dev/repl/b95ce66b0ef34064a34afc5c0249f313

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to hide (close) the Modal without losing it's edited content?

forna opened this issue · comments

commented

I have a Modal with some editable fields in it.
I would like to know if it's possible to keep the modal content, so basically just hide it when the Close button is clicked.
Currently when I close and reopen the Modal the editable fields content is lost.
I cannot simply save the Modal's form content because there are some <input type="file"> fields that cannot be instantiated again unless the user uploads the same files again.
Thank you.

There are many ways to achieve this. The easiest is to store the form content with svelte stores.

commented

I have tested another svelte modal based on micromodal called "svelte-micromodal", with that it works out of the box.
So I opt for that solution, thanks anyway.

bandicam.2023-04-17.10-03-59-112.mp4