Skip to content

Commit

Permalink
Fixed #11341 - pStyleClass may fail to enter the element
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Mar 26, 2022
1 parent 5b8e4d5 commit e1b0481
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/components/styleclass/styleclass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ export class StyleClass implements AfterViewInit, OnDestroy {
if (getComputedStyle(this.target).getPropertyValue('position') === 'static') {
this.unbindDocumentListener();
}
else if (!this.el.nativeElement.isSameNode(event.target) && !this.el.nativeElement.contains(event.target) && !this.target.contains(event.target)) {
else if (this.target.offsetParent !== null && !this.el.nativeElement.isSameNode(event.target)
&& !this.el.nativeElement.contains(event.target) && !this.target.contains(event.target)) {
this.leave();
}
});
Expand Down

0 comments on commit e1b0481

Please sign in to comment.