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

Expose the 'builder' property in the slots whenever the parent exposes the 'asChild' property. #735

Open
bfovez opened this issue Feb 2, 2024 · 1 comment
Labels
type: feature Introduction of new functionality to the application

Comments

@bfovez
Copy link

bfovez commented Feb 2, 2024

Describe the feature

I use this kind of thing:

<DropdownMenu.Item href={myHref} on:click={(e) => { ... e.preventDefault() ... }>
   ...
</DropdownMenu.Item>

I need fine control over the click event on the anchor. Indeed, the e.preventDefault() does not prevent the child anchor to actually trigger a nav action.
For that matter, I need to activate the asChild property, which is present, but the builder property is not exposed in the slot.

We could modify the code, but we would end up modify the code of a bunch of shadcn-svelte components, which would prevent us to take advantage of the improvements yet to come.

@bfovez bfovez added the type: feature Introduction of new functionality to the application label Feb 2, 2024
@huntabyte
Copy link
Owner

I'm open to someone adding this to all the components. I don't have the time/energy to do it at the moment, especially with snippets on the horizon.

@bfovez bfovez changed the title Expose the 'builder' property is the slots whenever the parent exposes the 'asChild' property. Expose the 'builder' property in the slots whenever the parent exposes the 'asChild' property. Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants