flekschas / svelte-simple-modal

A simple, small, and content-agnostic modal for Svelte v3 and v4
https://svelte.dev/repl/b95ce66b0ef34064a34afc5c0249f313
MIT License
422 stars 30 forks source link

Possible to fade in/out when changing content? #92

Closed ajmeese7 closed 1 year ago

ajmeese7 commented 1 year ago

I have the contents of my modal set to a Svelte writable store that I change the value on to manipulate the contents of the modal when the user is navigating options. Is it possible to have the fade in/out transition when the contents of the modal are being modified, so there isn't such an abrupt change?

Minimal example of my setup:

<script>
    import { writable } from "svelte/store";
    import Modal from "svelte-simple-modal";

    const modal = writable(null);
</script>

<Modal show={$modal} />
flekschas commented 1 year ago

My only idea on how to achieve this is by setting the modal to a component that fades between the content. However, this is outside the realm of this library so there isn't really anything I can do here. What you do within the modal component is up to you.