Fixed #2903 - Tooltip: add type/empty check for its value

pull/2929/head
mertsincan 2022-08-31 11:21:03 +01:00
parent a0f9d344a8
commit 5761c63410
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import {UniqueComponentId,DomHandler,ConnectedOverlayScrollHandler,ZIndexUtils} from 'primevue/utils';
import {UniqueComponentId,DomHandler,ObjectUtils,ConnectedOverlayScrollHandler,ZIndexUtils} from 'primevue/utils';
function bindEvents(el) {
const modifiers = el.$_ptooltipModifiers;
@ -300,7 +300,7 @@ const Tooltip = {
target.$_ptooltipFitContent = true;
}
else if (typeof options.value === 'object' && options.value) {
if (options.value.value === undefined || options.value.value === null || options.value.value.trim() === '') return;
if (ObjectUtils.isEmpty(options.value.value)) return;
else {
/* eslint-disable */
target.$_ptooltipValue = options.value.value;
@ -338,7 +338,7 @@ const Tooltip = {
target.$_ptooltipClass = null;
}
else if (typeof options.value === 'object' && options.value) {
if (options.value.value === undefined || options.value.value === null || options.value.value.trim() === '') return;
if (ObjectUtils.isEmpty(options.value.value)) return;
else {
/* eslint-disable */
target.$_ptooltipValue = options.value.value;