DEV Community

Discussion on: How to create a Full-Featured Modal Component in Svelte, and trap focus-within

Collapse
 
yawnxyz profile image
Jan Z

Wow, this is so great! Thanks for this writeup and demo, it really saved me a ton of time. Also, there's a small typo/bug — in your complete implementation:
<slot name="footer" {store}>

should say:
<slot name="footer" {close}>

in order to properly expose the close method.

Cheers and thanks!

Collapse
 
vibhanshu909 profile image
vibhanshu pandey

Thank You for noticing,
Fixed It, by updating its usage:-

<div slot="footer" let:store={{close}}>
    <button on:click={close}>Close First Modal</button>
</div>
Enter fullscreen mode Exit fullscreen mode