Skip to content

Commit

Permalink
dont run cd when mouseenter
Browse files Browse the repository at this point in the history
  • Loading branch information
wouter-willems committed Nov 25, 2024
1 parent 006b9a8 commit 4a34afc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/klippa/ngx-enhancy-forms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klippa/ngx-enhancy-forms",
"version": "18.25.2",
"version": "18.25.3",
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>
<ng-container [ngTemplateOutlet]="captionTpl"></ng-container>
<ng-container *ngIf="direction === 'vertical' && getErrorLocation() === 'belowCaption' && !errorMessageAsTooltip" [ngTemplateOutlet]="errorRef"></ng-container>
<div class="inputContainer" (mouseenter)="setErrorTooltipOffset()">
<div class="inputContainer" #inputContainer>
<ng-container *ngIf="errorMessageAsTooltip && shouldShowErrorMessages() && getErrorToShow()">
<div class="errorTooltipTriangle"></div>
<div class="errorTooltipTriangleWhite"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class FormElementComponent implements AfterViewInit, OnDestroy {
@ViewChild('absoluteAnchor') public absoluteAnchor: ElementRef;
@ViewChild('fixedAnchor') public fixedAnchor: ElementRef;
@ViewChild('fixedWrapper') public fixedWrapper: ElementRef;
@ViewChild('inputContainer') public inputContainer: ElementRef;
@ContentChild(NG_VALUE_ACCESSOR) fieldInput: ValueAccessorBase<any>;

public captionRef: TemplateRef<any>;
Expand All @@ -80,6 +81,11 @@ export class FormElementComponent implements AfterViewInit, OnDestroy {
if (isValueSet(subscription)) {
this.subscriptions.push(subscription);
}
this.ngZone.runOutsideAngular(() => {
this.inputContainer?.nativeElement.addEventListener('mouseenter', () => {
this.setErrorTooltipOffset();
});
});
}

public shouldShowErrorMessages(): boolean {
Expand Down

0 comments on commit 4a34afc

Please sign in to comment.