Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API #58

Open
MentalGear opened this issue Feb 23, 2024 · 2 comments
Open

API #58

MentalGear opened this issue Feb 23, 2024 · 2 comments

Comments

@MentalGear
Copy link

MentalGear commented Feb 23, 2024

Describe the feature in detail (code, mocks, or screenshots encouraged)

Thanks for porting this to svelte!

A code-only API (not bound to components) would be tremendously helpful, e.g. for triggering the drawer/modal in shallow routing (sveltekit) or just closing it from an lower component (like a form). Thx!

What type of pull request would this be?

None

Provide relevant links or additional information.

No response

@huntabyte
Copy link
Owner

Can you provide some more details on what you're looking to do?

@k00lagin
Copy link

k00lagin commented Mar 7, 2024

@MentalGear Don't know if your use case is similar to mine. I've checked lib sources and come up with this solution to use drawer with shallow routing. Assuming minimal example, you can replace this part:

{#if $page.state.showModal}
    <Modal close={() => history.back()} />
{/if}

with this:

<Drawer.Root open={$page.state.showModal} onClose={()=>history.back()}>
    <!-- CONTENTS -->
    <!-- Dont add trigger here, use showModal() instead -->
</Drawer.Root>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants