Fixed #1404 - value and disabled props for Tooltip

pull/1408/head
Tuğçe Küçükoğlu 2021-08-04 12:17:15 +03:00
parent 6795e5070f
commit 6e119d9ac2
1 changed files with 19 additions and 3 deletions

View File

@ -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;
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;
if (typeof options.value === 'string') {
target.$_ptooltipValue = options.value;
target.$_ptooltipDisabled = false;
}
else {
target.$_ptooltipValue = options.value.value;
target.$_ptooltipDisabled = options.value.disabled;
}
},
};