Skip to content

Using nested components #18

@davemccrea

Description

@davemccrea

I'm encountering a TypeError: outros is undefined when using a nested component.

App.svelte

...
<Modal>
    <Delivery />
<Modal />

Delivery.svelte

...
const { open } = getContext('simple-modal');

function showCardPickerModal() {
    open(CardPicker);
}

CardPicker.svelte

<script>
import Card from './Card.svelte
<script />

<Card />

Card.svelte

<h1>Some text</h1>

The modal opens, however when using the close button or clicking the background the error appears in the browser console window. All works as expected when I don't use a nested component within the CardPicker component. Is this a limitation of Svelte or svelte-simple-modal?

Using latest Svelte and svelte-simple-modal version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions