From 3fe4a807bdb62f8fde049db0da48280b1edd3c4a Mon Sep 17 00:00:00 2001 From: yigitfindikli Date: Mon, 28 Mar 2022 17:21:25 +0300 Subject: [PATCH] Fixed #11348 - Tooltip escape parameter not working after update --- src/app/components/tooltip/tooltip.ts | 7 +++---- src/app/components/utils/objectutils.ts | 10 ---------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/app/components/tooltip/tooltip.ts b/src/app/components/tooltip/tooltip.ts index 400d687a05e..0a802181ecc 100755 --- a/src/app/components/tooltip/tooltip.ts +++ b/src/app/components/tooltip/tooltip.ts @@ -1,7 +1,7 @@ import { NgModule, Directive, ElementRef, AfterViewInit, OnDestroy, Input, NgZone, SimpleChanges } from '@angular/core'; import { CommonModule } from '@angular/common'; import { DomHandler, ConnectedOverlayScrollHandler } from 'primeng/dom'; -import { ObjectUtils, ZIndexUtils } from 'primeng/utils' +import { ZIndexUtils } from 'primeng/utils' import { PrimeNGConfig } from 'primeng/api'; export interface TooltipOptions { @@ -70,7 +70,7 @@ export class Tooltip implements AfterViewInit, OnDestroy { tooltipEvent: 'hover', appendTo: 'body', tooltipZIndex: 'auto', - escape: false, + escape: true, positionTop: 0, positionLeft: 0 } @@ -332,8 +332,7 @@ export class Tooltip implements AfterViewInit, OnDestroy { this.tooltipText.appendChild(document.createTextNode(this.getOption('tooltipLabel'))); } else { - let tooltipLabel = ObjectUtils.htmlEncode(this.getOption('tooltipLabel')); - this.tooltipText.innerHTML = tooltipLabel; + this.tooltipText.innerHTML = this.getOption('tooltipLabel'); } } diff --git a/src/app/components/utils/objectutils.ts b/src/app/components/utils/objectutils.ts index 6aea0e4612f..bad498e8dbe 100755 --- a/src/app/components/utils/objectutils.ts +++ b/src/app/components/utils/objectutils.ts @@ -173,16 +173,6 @@ export class ObjectUtils { return str; } - public static htmlEncode(str){ - if (str) { - return str.replace(/[^\w. ]/gi, function(c){ - return '&#'+c.charCodeAt(0)+';'; - }); - } - - return null; - } - public static isEmpty(value) { return ( value === null || value === undefined || value === '' ||