diff --git a/src/components/tooltip/Tooltip.js b/src/components/tooltip/Tooltip.js index 1870c341b..5eabdf6cb 100755 --- a/src/components/tooltip/Tooltip.js +++ b/src/components/tooltip/Tooltip.js @@ -63,7 +63,7 @@ function onClick(event) { } function show(el) { - if (!el.$_ptooltipValue) { + if (el.$_ptooltipDisabled) { return; } @@ -245,7 +245,15 @@ const Tooltip = { beforeMount(el, options) { let target = getTarget(el); target.$_ptooltipModifiers = options.modifiers; - target.$_ptooltipValue = options.value; + if (typeof options.value === 'string') { + target.$_ptooltipValue = options.value; + target.$_ptooltipDisabled = false; + } + else { + target.$_ptooltipValue = options.value.value; + target.$_ptooltipDisabled = options.value.disabled || false; + } + target.$_ptooltipZIndex = options.instance.$primevue && options.instance.$primevue.config && options.instance.$primevue.config.zIndex.tooltip; bindEvents(target); }, @@ -264,7 +272,15 @@ const Tooltip = { updated(el, options) { let target = getTarget(el); target.$_ptooltipModifiers = options.modifiers; - target.$_ptooltipValue = options.value; + + if (typeof options.value === 'string') { + target.$_ptooltipValue = options.value; + target.$_ptooltipDisabled = false; + } + else { + target.$_ptooltipValue = options.value.value; + target.$_ptooltipDisabled = options.value.disabled; + } }, };