diff --git a/src/components/tooltip/Tooltip.js b/src/components/tooltip/Tooltip.js index ac85be43d..e2d3b1049 100755 --- a/src/components/tooltip/Tooltip.js +++ b/src/components/tooltip/Tooltip.js @@ -219,12 +219,10 @@ function alignBottom(el) { } function preAlign(el, position) { - const tipClass = el.$_ptooltipClass; let tooltipElement = getTooltipElement(el); tooltipElement.style.left = -999 + 'px'; tooltipElement.style.top = -999 + 'px'; - tooltipElement.className = 'p-tooltip p-component p-tooltip-' + position; - if (tipClass) tooltipElement.className += ' p-tooltip-' + tipClass; + tooltipElement.className = `p-tooltip p-component p-tooltip-${position} ${el.$_ptooltipClass||''}`; } function isOutOfBounds(el) { @@ -274,7 +272,7 @@ const Tooltip = { else { target.$_ptooltipValue = options.value.value; target.$_ptooltipDisabled = options.value.disabled || false; - target.$_ptooltipClass = options.value.class || false; + target.$_ptooltipClass = options.value.class; } target.$_ptooltipZIndex = options.instance.$primevue && options.instance.$primevue.config && options.instance.$primevue.config.zIndex.tooltip; @@ -305,7 +303,7 @@ const Tooltip = { else { target.$_ptooltipValue = options.value.value; target.$_ptooltipDisabled = options.value.disabled || false; - target.$_ptooltipClass = options.value.class || false; + target.$_ptooltipClass = options.value.class; } } }; diff --git a/src/views/tooltip/TooltipDemo.vue b/src/views/tooltip/TooltipDemo.vue index a1e0c28f6..0acd2931e 100755 --- a/src/views/tooltip/TooltipDemo.vue +++ b/src/views/tooltip/TooltipDemo.vue @@ -33,7 +33,7 @@