Skip to content

Commit 142c54a

Browse files
committed
Use native title attribute for clamp tooltip in Heading component
Bootstrap-Vue's v-b-tooltip directive warns about invalid HTML element targets in the happy-dom test environment, failing any test that uses Heading via vitest-fail-on-console. Native title attribute avoids this and still shows the full text on hover.
1 parent 37de2be commit 142c54a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client/src/components/Common/Heading.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ function checkClamped() {
6767
6868
const clampTooltip = computed(() => {
6969
if (isClamped.value) {
70-
return headingRef.value?.textContent?.trim() ?? "";
70+
return headingRef.value?.textContent?.trim() ?? null;
7171
}
72-
return "";
72+
return null;
7373
});
7474
7575
const clampStyle = computed(() => {
@@ -93,7 +93,7 @@ onUpdated(() => nextTick(checkClamped));
9393
<component
9494
:is="element"
9595
ref="headingRef"
96-
v-b-tooltip.hover="clampTooltip"
96+
:title="clampTooltip"
9797
:class="[
9898
sizeClass,
9999
props.bold ? 'font-weight-bold' : '',
@@ -111,7 +111,7 @@ onUpdated(() => nextTick(checkClamped));
111111
:is="element"
112112
v-else
113113
ref="headingRef"
114-
v-b-tooltip.hover="clampTooltip"
114+
:title="clampTooltip"
115115
class="heading word-wrap-break"
116116
:class="[
117117
sizeClass,

0 commit comments

Comments
 (0)