Skip to content

Commit

Permalink
fix(list-item): Reserve space for empty open lists. (#8239)
Browse files Browse the repository at this point in the history
**Related Issue:** #8242

## Summary

- Specifies padding on a list that has no list items inside it
- This allows for easier dragging into the empty list.
- This could be a quick fix for the issue and design could come up with
something better.
- add story
  • Loading branch information
driskull authored and benelan committed Nov 24, 2023
1 parent 409c999 commit 13f342e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,8 @@ td:focus {
@apply border-solid border-0 border-t border-color-3;
}

::slotted(calcite-list:empty) {
@apply py-3;
}

@include base-component();
37 changes: 37 additions & 0 deletions packages/calcite-components/src/components/list/list.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,43 @@ export const sortableNestedList_TestOnly = (): string => html`<calcite-list
<calcite-list-item label="Hi! 7" description="hello world"></calcite-list-item>
</calcite-list>`;

export const emptyOpenLists_TestOnly = (): string => html`<calcite-list
drag-enabled
group="nested"
label="test"
selection-mode="multiple"
>
<calcite-list-item open label="Hi! 1" description="hello world">
<calcite-list drag-enabled group="nested" selection-mode="multiple">
<calcite-list-item open label="Hi! 2" description="hello world">
<calcite-list drag-enabled group="nested" selection-mode="multiple">
<calcite-list-item open label="Hi! 3" description="hello world">
<calcite-action-menu overlay-positioning="fixed" slot="actions-end">
<calcite-action text-enabled text="Edit" icon="pencil"></calcite-action>
<calcite-action text-enabled text="Delete" icon="trash"></calcite-action>
<calcite-action text-enabled text="Delete" icon="trash"></calcite-action>
<calcite-action text-enabled text="Delete" icon="trash"></calcite-action>
<calcite-action text-enabled text="Delete" icon="trash"></calcite-action>
</calcite-action-menu>
<calcite-list drag-enabled group="nested" selection-mode="multiple"></calcite-list>
</calcite-list-item>
<calcite-list-item open label="Hi! 4" description="hello world">
<calcite-list drag-enabled group="nested" selection-mode="multiple"></calcite-list>
</calcite-list-item>
</calcite-list>
</calcite-list-item>
<calcite-list-item open label="Hi! 5" description="hello world">
<calcite-list drag-enabled group="nested" selection-mode="multiple"></calcite-list>
</calcite-list-item>
</calcite-list>
</calcite-list-item>
<calcite-list-item open label="Hi! 6" description="hello world">
<calcite-list drag-enabled group="nested" selection-mode="multiple"></calcite-list>
</calcite-list-item>
<calcite-list-item open label="Hi! 7" description="hello world">
<calcite-list drag-enabled group="nested" selection-mode="multiple"></calcite-list></calcite-list-item
></calcite-list>`;

export const listWithEmptyChildList_TestOnly = (): string => html`<calcite-list
drag-enabled
group="nested"
Expand Down

0 comments on commit 13f342e

Please sign in to comment.