-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat(value-list-item): add new slot labelled as content-center to replace label/description (#3373) #3579
Conversation
…/3373-value-list-label
@y0n4 can you add a test for this? Maybe a screener update to show an item without a title? |
@asangma Can you confirm if having no content still fits with the standardized item layout pattern
? |
If I understand correctly, you want to know if no As far as that layout pattern, that' pretty much it, though the full pattern wraps the content slots and node in a button. |
@asangma yes that is correct. Should the component require a label or can it be empty and the slots will stretch the rest of the space? There is that whole empty gap around the label area because it is expecting a label. The e2e test is also expecting a label as well so if it's not required, the test will fail It is a bit confusing since label prop is required in |
|
Because the request is focused on allowing custom content in the main content area, I suggest that we
This way a user can do like <calcite-pick-list-item>
<calcite-action slot="actions-end"></calcite-action>
<calcite-label>
<calcite-input />
</calcite-label>
<!-- or whatever -->
</calcite-pick-list-item> |
…d add prop documentation
…components into y0n4/3373-value-list-label
…/3373-value-list-label
@driskull I'm thinking that if the |
@asangma I think some more research needs to happen here. The role of a pick-list-item is a checkbox. If a user slots an input inside of a pick-list-item, then its basically like putting a input inside a checkbox. If we remove the checkbox role, then it's no longer able to "pick". The purpose of this slot needs to be clarified and limited otherwise we are setting users up for a11y failures and breaking changes down the road for us. |
If a input needs to be slotted, it needs to go next to the checkbox role, not inside it. |
Apologies for not chiming in sooner. I'll review first thing tomorrow. |
Here is the basic concept. I'd like to run the UI (see below) through a design review. I have some initial UI stuff here. |
Maybe two separate item types since the UI will be different depending on a slot being used? I'm not sure where we draw the line and say its a separate item component rather than it renders differently when things are slotted. |
I considered that. However, one of the workflows/UX in question is being able to do some kind of inline editing, e.g. temporarily replace the standard content with an input. |
I'd be willing to remove the select/deselect button when "content" slot is used. |
At what point is a regular list item more apt? |
@macandcheese A dev could do that, but ListItem doesn't come with all the single-select, multi-select and prescribed icons (check vs radio). |
Really, this is a pattern we use in a couple other places, i.e. having a slot that overrides a main content area. That being said, I'm open to other solutions for the initial request to have inline editable text. |
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
Blocking and freezing this one until we flesh out the details for the action/content slot pattern epic. @y0n4 @asangma @driskull @macandcheese Thanks for the time and energy on this, but the implementation of this brought up some items that needed to be well-defined first. |
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
Related Issue: #3373
Summary
In the case of when the
label
anddescription
prop is not utilized, there is a customcontent
slot that can replace the area of the label/description. This way there won't be a big gap in the middle of the component and no need to squish more content to the other slots likeactions-start
oractions-end
. Label/description or content slot must be provided while using thecalcite-pick-list-item
componentContent slot will take precedence over label/description if provided.
When the list item is interactive and has content slot, the item can be selected if user clicks outside of the content slot.
Before: you can see that there is an empty gap where the label/description is supposed to be and the user wants to include more content
After: now label/description can be replaced with custom content and there is no longer that empty gap