-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
Add support for sl-dropdown in the default slot of sl-breadcrumb-item #2015
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! (And makes me want hrefs for menu items even more!)
@claviska I dont see any issue here.
Perhaps a different problem for a different day, but we may want to expose some way to style these breadcrumbs differently based on the renderType
.
Before you could check the href
attribute, now its a little murkier because the labels dont have parts that correspond, and the renderType doesn't get reflected.
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
Hi @KonnorRogers, thank you for your input. I just committed your suggestions, seems fine for me.
You are right, we should think about this. Currently, you could use a slotted selector, but thats not nice at all. Conditionally setting the |
Would this be for user's custom styles? If so, can the |
It would be a possibility for sure. |
Thank you for the solid PR! |
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 thehref
attribute alone to render. Instead, a new staterenderType
is created that may hold one of the following values:'button' | 'link' | 'drop-down'
. As before, it defaults tobutton
, 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 todrop-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.