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
Hello, thank you for this fantastic port to svelte.
I think the Modal component needs more flexibility for closing. It seems the only way right now is to provide a mutable variable that the modal can toggle.
There are situations where, the state of the modal is not directly binded to a simple boolean, but it is a derived value from some store or something like that.
Basic example
I have a modal that shows the currently selected "item", which is only open if such item is not null. There is no boolean to directly bind to (nor I want to have a separate boolean just for opening closing the modal). I tried binding a function to the on:close event, but it seems that your component does not call it for closing, just calls it's internal hide method that toggles (or tries to) the boolean.
Motivation
I want finer grained control over the modal open/close state
The text was updated successfully, but these errors were encountered:
I ended up using the raw formatted/styled html and adding my own bindings. I needed to handle on:submit for an embedded form and binding on the close & key event of "Escape" is all pretty trivial. I do think that on:close and on:cancel events should be invoked however by the lib 👍
Summary
Hello, thank you for this fantastic port to svelte.
I think the Modal component needs more flexibility for closing. It seems the only way right now is to provide a mutable variable that the modal can toggle.
There are situations where, the state of the modal is not directly binded to a simple boolean, but it is a derived value from some store or something like that.
Basic example
I have a modal that shows the currently selected "item", which is only open if such item is not null. There is no boolean to directly bind to (nor I want to have a separate boolean just for opening closing the modal). I tried binding a function to the on:close event, but it seems that your component does not call it for closing, just calls it's internal hide method that toggles (or tries to) the boolean.
Motivation
I want finer grained control over the modal open/close state
The text was updated successfully, but these errors were encountered: