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

Add support for sl-dropdown in the default slot of sl-breadcrumb-item #2015

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

schilchSICKAG
Copy link
Contributor

This PR adds the ability to add <sl-dropdown> in the default slot of a <sl-breadcrumb-item> as requested and discussed in #2011, this feature.

The following changes where made to make this work:

The render call does not rely on the href attribute alone to render. Instead, a new state renderType is created that may hold one of the following values: 'button' | 'link' | 'drop-down'. As before, it defaults to button, making all original examples work.

A slotChange listener is bound to all default slots that checks for availability of a slotted <sl-dropdown>. If one is found, the render type is set to drop-down. In all other cases, the logic from the original rendering applies.

I also have added tests and updated the documentation. However, I am unsure how to document this. Should we leave the initial example as is or create a new one (which I did in this PR)?

Looking forward to your suggestions.

Copy link

vercel bot commented May 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
shoelace ✅ Ready (Inspect) Visit Preview May 24, 2024 11:59am

@schilchSICKAG schilchSICKAG changed the title Add support for dropdowns in the default slot Add support for sl-dropdown in the default slot of sl-breadcrumb-item May 14, 2024
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

Successfully merging this pull request may close these issues.

None yet

1 participant