Fixed #4738 - Tooltip: escape should be false by default

pull/4759/head
tugcekucukoglu 2023-11-02 13:50:06 +03:00
parent 5ee9ac2d86
commit 95e8936be1
2 changed files with 7 additions and 7 deletions

View File

@ -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;
/**

View File

@ -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 = '';