Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/element-list-item-icons-top.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@milaboratories/uikit": patch
---

PlElementListItem: wrap drag handle and chevron into a single container aligned to the top of the head, so icons stay on the first title line with multiline titles
32 changes: 21 additions & 11 deletions lib/ui/uikit/src/components/PlElementList/PlElementListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,20 @@ const emit = defineEmits<{
]"
@click="isExpandable && emit('expand', props.item, props.index)"
>
<div
v-if="props.showDragHandle"
:class="[$style.action, $style.draggable, { [$style.disable]: !props.isDraggable }]"
:data-draggable="props.isDraggable"
>
<PlIcon16 name="drag-dots" />
<div v-if="props.showDragHandle || isExpandable" :class="$style.headIcons">
<div
v-if="props.showDragHandle"
:class="[$style.action, $style.draggable, { [$style.disable]: !props.isDraggable }]"
:data-draggable="props.isDraggable"
>
<PlIcon16 name="drag-dots" />
</div>
<PlIcon16
v-if="isExpandable"
:class="[$style.contentChevron, { [$style.opened]: props.isExpanded }]"
name="chevron-down"
/>
</div>
<PlIcon16
v-if="isExpandable"
:class="[$style.contentChevron, { [$style.opened]: props.isExpanded }]"
name="chevron-down"
/>

<div :class="$style.title">
<slot name="title" :item="props.item" :index="props.index" />
Expand Down Expand Up @@ -194,6 +196,14 @@ const emit = defineEmits<{
background: var(--head-background);
}

.headIcons {
display: flex;
align-items: center;
align-self: flex-start;
height: 24px;
flex: 0 0 auto;
}

.contentChevron {
display: block;
width: 16px;
Expand Down
Loading