Skip to content

Commit

Permalink
fix(kbadge, kcopy): minor fix (#2218)
Browse files Browse the repository at this point in the history
  • Loading branch information
portikM authored and adamdehaven committed Jun 15, 2024
1 parent 690e5c8 commit 6f2cb0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/KBadge/KBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const maxWidth = computed((): string => getSizeFromString(props.maxWidth))
const setTruncation = async (): Promise<void> => {
if (badgeTextElement.value) {
await nextTick()
isTruncated.value = badgeTextElement.value.offsetWidth < badgeTextElement.value.scrollWidth
isTruncated.value = badgeTextElement.value?.offsetWidth < badgeTextElement.value?.scrollWidth
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/KCopy/KCopy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const setTruncation = (): void => {
if (props.truncationLimit !== 'auto' && truncateLimitText.value) {
isTruncated.value = true
} else if (props.truncationLimit === 'auto' && copyTextElement.value) {
isTruncated.value = copyTextElement.value.offsetWidth < copyTextElement.value.scrollWidth
isTruncated.value = copyTextElement.value?.offsetWidth < copyTextElement.value?.scrollWidth
}
}
Expand Down

0 comments on commit 6f2cb0a

Please sign in to comment.