From 5761c6341089d28d53ca4699549c7eb4402d63c9 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 31 Aug 2022 11:21:03 +0100 Subject: [PATCH] Fixed #2903 - Tooltip: add type/empty check for its value --- src/components/tooltip/Tooltip.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/tooltip/Tooltip.js b/src/components/tooltip/Tooltip.js index 28d378723..fbff4e0e9 100755 --- a/src/components/tooltip/Tooltip.js +++ b/src/components/tooltip/Tooltip.js @@ -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;