NIFI-13855: Ensuring that tooltips get closed when the host component is clicked. (#9376)

This closes #9376
This commit is contained in:
Matt Gilman 2024-10-11 12:15:08 -04:00 committed by GitHub
parent f3fcedc864
commit 3ab60859ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 27 additions and 18 deletions

View File

@ -59,8 +59,35 @@ export class NifiTooltipDirective<T> implements OnDestroy {
}
}
@HostListener('mousemove')
mouseMove() {
if (this.overlayRef?.hasAttached() && this.tooltipDisabled) {
this.overlayRef?.detach();
if (this.positionStrategy?.detach) {
this.positionStrategy.detach();
}
}
}
@HostListener('mouseup')
mouseup() {
if (!this.overlayRef?.hasAttached()) {
this.attach();
}
}
@HostListener('mouseleave')
mouseLeave() {
this.closeTip();
}
@HostListener('click')
click() {
this.closeTip();
}
private closeTip(): void {
if (this.overlayRef?.hasAttached() && !this.overTip) {
if (this.delayClose) {
this.closeTimer = window.setTimeout(() => {
@ -87,24 +114,6 @@ export class NifiTooltipDirective<T> implements OnDestroy {
}
}
@HostListener('mousemove')
mouseMove() {
if (this.overlayRef?.hasAttached() && this.tooltipDisabled) {
this.overlayRef?.detach();
if (this.positionStrategy?.detach) {
this.positionStrategy.detach();
}
}
}
@HostListener('mouseup')
mouseup() {
if (!this.overlayRef?.hasAttached()) {
this.attach();
}
}
ngOnDestroy(): void {
this.overlayRef?.dispose();
this.positionStrategy?.dispose();