From 95e8936be1ab18bfc853c0da60c1a9fa4db19d1c Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Thu, 2 Nov 2023 13:50:06 +0300 Subject: [PATCH] Fixed #4738 - Tooltip: escape should be false by default --- components/lib/tooltip/Tooltip.d.ts | 4 ++-- components/lib/tooltip/Tooltip.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/lib/tooltip/Tooltip.d.ts b/components/lib/tooltip/Tooltip.d.ts index 2995cba15..c76625579 100755 --- a/components/lib/tooltip/Tooltip.d.ts +++ b/components/lib/tooltip/Tooltip.d.ts @@ -47,8 +47,8 @@ export interface TooltipOptions { */ class?: string | undefined; /** - * By default the tooltip contents are not rendered as text. Set to true to support html tags in the content. - * @defaultValue false + * By default the tooltip contents are not rendered as text. Set to false to support html tags in the content. + * @defaultValue true */ escape?: boolean | undefined; /** diff --git a/components/lib/tooltip/Tooltip.js b/components/lib/tooltip/Tooltip.js index 62e0c0cf5..6c5896cb3 100755 --- a/components/lib/tooltip/Tooltip.js +++ b/components/lib/tooltip/Tooltip.js @@ -11,7 +11,7 @@ const Tooltip = BaseTooltip.extend('tooltip', { else if (typeof options.value === 'string') { target.$_ptooltipValue = options.value; target.$_ptooltipDisabled = false; - target.$_ptooltipEscape = false; + target.$_ptooltipEscape = true; target.$_ptooltipClass = null; target.$_ptooltipFitContent = true; target.$_ptooltipIdAttr = UniqueComponentId() + '_tooltip'; @@ -23,7 +23,7 @@ const Tooltip = BaseTooltip.extend('tooltip', { else { target.$_ptooltipValue = options.value.value; target.$_ptooltipDisabled = !!options.value.disabled === options.value.disabled ? options.value.disabled : false; - target.$_ptooltipEscape = !!options.value.escape === options.value.escape ? options.value.escape : false; + target.$_ptooltipEscape = !!options.value.escape === options.value.escape ? options.value.escape : true; target.$_ptooltipClass = options.value.class || ''; target.$_ptooltipFitContent = !!options.value.fitContent === options.value.fitContent ? options.value.fitContent : true; target.$_ptooltipIdAttr = options.value.id || UniqueComponentId() + '_tooltip'; @@ -52,7 +52,7 @@ const Tooltip = BaseTooltip.extend('tooltip', { if (typeof options.value === 'string') { target.$_ptooltipValue = options.value; target.$_ptooltipDisabled = false; - target.$_ptooltipEscape = false; + target.$_ptooltipEscape = true; target.$_ptooltipClass = null; target.$_ptooltipIdAttr = target.$_ptooltipIdAttr || UniqueComponentId() + '_tooltip'; target.$_ptooltipShowDelay = 0; @@ -68,7 +68,7 @@ const Tooltip = BaseTooltip.extend('tooltip', { } else { target.$_ptooltipValue = options.value.value; target.$_ptooltipDisabled = !!options.value.disabled === options.value.disabled ? options.value.disabled : false; - target.$_ptooltipEscape = !!options.value.escape === options.value.escape ? options.value.escape : false; + target.$_ptooltipEscape = !!options.value.escape === options.value.escape ? options.value.escape : true; target.$_ptooltipClass = options.value.class || ''; target.$_ptooltipFitContent = !!options.value.fitContent === options.value.fitContent ? options.value.fitContent : true; target.$_ptooltipIdAttr = options.value.id || target.$_ptooltipIdAttr || UniqueComponentId() + '_tooltip'; @@ -267,7 +267,7 @@ const Tooltip = BaseTooltip.extend('tooltip', { }) }); - if (el.$_ptooltipEscape) { + if (!el.$_ptooltipEscape) { tooltipText.innerHTML = el.$_ptooltipValue; } else { tooltipText.innerHTML = '';