Skip to content

Commit

Permalink
Fixed #11348 - Tooltip escape parameter not working after update
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Mar 28, 2022
1 parent 829b2fd commit 3fe4a80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
7 changes: 3 additions & 4 deletions src/app/components/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -70,7 +70,7 @@ export class Tooltip implements AfterViewInit, OnDestroy {
tooltipEvent: 'hover',
appendTo: 'body',
tooltipZIndex: 'auto',
escape: false,
escape: true,
positionTop: 0,
positionLeft: 0
}
Expand Down Expand Up @@ -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');
}
}

Expand Down
10 changes: 0 additions & 10 deletions src/app/components/utils/objectutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '' ||
Expand Down

0 comments on commit 3fe4a80

Please sign in to comment.