Skip to content

Commit bf25e88

Browse files
committed
Admin: Fix tree item label truncation and active highlight
- Truncate label text with ellipsis instead of silent clipping - Keep badges visible by moving overflow from label to first child - Extend active highlight to container border using padding/margin bleed
1 parent c69af0f commit bf25e88

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

packages/admin/src/components/DitoTreeItem.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,14 @@ export default DitoComponent.component('DitoTreeItem', {
321321
--chevron-indent: #{$chevron-indent};
322322
323323
overflow: hidden;
324+
padding: 0 $input-padding-hor;
325+
margin: 0 (-$input-padding-hor);
324326
325327
> .dito-tree-header {
328+
// Extend header into item padding so active background reaches the edge:
329+
margin: 0 (-$input-padding-hor);
330+
padding: 0 $input-padding-hor;
331+
326332
> .dito-tree-branch,
327333
> .dito-tree-leaf {
328334
// Use `--level` CSS variable to calculated the accumulated indent
@@ -356,8 +362,13 @@ export default DitoComponent.component('DitoTreeItem', {
356362
display: flex;
357363
align-items: baseline;
358364
gap: 0.25em;
359-
overflow: hidden;
365+
min-width: 0;
360366
white-space: nowrap;
367+
368+
> :first-child {
369+
overflow: hidden;
370+
text-overflow: ellipsis;
371+
}
361372
}
362373
363374
.dito-tree-info {
@@ -395,8 +406,6 @@ export default DitoComponent.component('DitoTreeItem', {
395406
&--active {
396407
> .dito-tree-header {
397408
background: $color-active;
398-
padding: 0 $input-padding-hor;
399-
margin: 0 (-$input-padding-hor);
400409
401410
> .dito-tree-branch {
402411
> .dito-chevron::before {

0 commit comments

Comments
 (0)