Skip to content

Commit a32e050

Browse files
committed
Add warning if someone not define correctly a title to display for the tooltip
1 parent eeff562 commit a32e050

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/bootstrap-vue-3/src/directives/BTooltip.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,13 @@ const resolveDelay = (values: DirectiveBinding['value']): Tooltip.Options['delay
6565
return 0
6666
}
6767

68-
const resolveTitle = (values: DirectiveBinding['value']): Tooltip.Options['title'] | undefined =>
69-
typeof values === 'object' ? values?.title : values
68+
const resolveTitle = (values: DirectiveBinding['value']): Tooltip.Options['title'] | undefined => {
69+
if (typeof values === 'undefined') {
70+
console.warn('Review tooltip directive usage. Some uses are not defining a title in root component or a value like `v-b-tooltip=\'{title: "my title"}\'` nor `v-b-tooltip="\'my title\'"` to define a title');
71+
return;
72+
}
73+
return typeof values === 'object' ? values?.title : values;
74+
}
7075

7176
/**
7277
* @external

0 commit comments

Comments
 (0)