Skip to content

Commit

Permalink
fix(VChip): overflow text in chip selections (#17283)
Browse files Browse the repository at this point in the history
fixes #16472
  • Loading branch information
johnleider committed May 9, 2023
1 parent 6f67aad commit 0a681c8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
10 changes: 10 additions & 0 deletions packages/vuetify/src/components/VChip/VChip.sass
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
align-items: center
cursor: default
display: inline-flex
flex: 1 0
font-weight: $chip-font-weight
max-width: $chip-max-width
min-width: 0
overflow: hidden
position: relative
text-decoration: none
Expand Down Expand Up @@ -36,6 +38,14 @@
@include tools.rounded($chip-label-border-radius)

// Elements
.v-chip__content
.v-autocomplete__selection &,
.v-combobox__selection &,
.v-select__selection &
overflow: hidden
text-overflow: ellipsis
white-space: nowrap

.v-chip__filter,
.v-chip__prepend,
.v-chip__append,
Expand Down
18 changes: 10 additions & 8 deletions packages/vuetify/src/components/VChip/VChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,16 @@ export const VChip = genericComponent<VChipSlots>()({
</div>
)}

{ slots.default?.({
isSelected: group?.isSelected.value,
selectedClass: group?.selectedClass.value,
select: group?.select,
toggle: group?.toggle,
value: group?.value.value,
disabled: props.disabled,
}) ?? props.text }
<div class="v-chip__content">
{ slots.default?.({
isSelected: group?.isSelected.value,
selectedClass: group?.selectedClass.value,
select: group?.select,
toggle: group?.toggle,
value: group?.value.value,
disabled: props.disabled,
}) ?? props.text }
</div>

{ hasAppend && (
<div key="append" class="v-chip__append">
Expand Down

0 comments on commit 0a681c8

Please sign in to comment.