Skip to content

Commit

Permalink
feat(SegmentGroupControls): ellipsis + tooltip for long seg names
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Oct 21, 2024
1 parent 155f694 commit 4cd5284
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/components/EditableChipList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const props = withDefaults(
const itemsToRender = computed(() =>
props.items.map((item) => ({
key: item[props.itemKey] as string | number | symbol,
title: item[props.itemTitle],
title: item[props.itemTitle] as string | undefined,
}))
);
</script>
Expand All @@ -47,7 +47,11 @@ const itemsToRender = computed(() =>
@click="toggle"
>
<slot name="item-prepend" :key="key" :item="items[idx]"></slot>
<span class="overflow-hidden">{{ title }}</span>
<v-tooltip :text="title" location="end">
<template #activator="{ props }">
<span v-bind="props" class="text-truncate">{{ title }}</span>
</template>
</v-tooltip>
<v-spacer />
<slot name="item-append" :key="key" :item="items[idx]"></slot>
</v-chip>
Expand Down
2 changes: 0 additions & 2 deletions src/components/SegmentList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ const toggleVisible = (value: number) => {
});
};
// If all selected tools are already hidden, it should be "show".
// If at least one selected tool is visible, it should be "hide".
const allVisible = computed(() => {
return segments.value.every((seg) => seg.visible);
});
Expand Down

0 comments on commit 4cd5284

Please sign in to comment.