Skip to content

Commit bd9e662

Browse files
authored
Merge pull request #5505 from IgniteUI/mvenkov/fix-svg-use-tags
Add pointerEvents: none to use tag of icon's svg
2 parents 1d45e7f + 6c49b90 commit bd9e662

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

projects/igniteui-angular/src/lib/core/styles/components/icon/_icon-theme.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
width: inherit;
6262
height: inherit;
6363
fill: currentColor;
64+
65+
use {
66+
pointer-events: none;
67+
}
6468
}
6569
}
6670

projects/igniteui-angular/src/lib/services/overlay/overlay.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,15 +620,14 @@ export class IgxOverlayService implements OnDestroy {
620620
return;
621621
}
622622
if (info.settings.closeOnOutsideClick) {
623+
const target = ev.target as any;
623624
// if the click is on the element do not close this overlay
624-
if (!info.elementRef.nativeElement.contains(ev.target)) {
625+
if (!info.elementRef.nativeElement.contains(target)) {
625626
// if we should exclude position target check if the click is over it. If so do not close overlay
626627
const positionTarget = info.settings.positionStrategy.settings.target as HTMLElement;
627628
let clickOnPositionTarget = false;
628629
if (positionTarget) {
629-
const positionTargetRect = positionTarget.getBoundingClientRect();
630-
clickOnPositionTarget = ev.clientX >= positionTargetRect.left && ev.clientX <= positionTargetRect.right &&
631-
ev.clientY >= positionTargetRect.top && ev.clientY <= positionTargetRect.bottom;
630+
clickOnPositionTarget = positionTarget.contains(target);
632631
}
633632

634633
if (!(info.settings.excludePositionTarget && clickOnPositionTarget)) {

0 commit comments

Comments
 (0)