From c8caad2950eb4bebb9c9d4aafc486c20c2836003 Mon Sep 17 00:00:00 2001 From: Alexandr <42899726+al-march@users.noreply.github.com> Date: Tue, 10 Sep 2024 12:15:51 +0300 Subject: [PATCH] feat(core): ngx-floating onPush strategy (#181) --- packages/core/src/lib/floating/floating.component.scss | 1 + packages/core/src/lib/floating/floating.component.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/lib/floating/floating.component.scss b/packages/core/src/lib/floating/floating.component.scss index af1f29c..ec651cc 100644 --- a/packages/core/src/lib/floating/floating.component.scss +++ b/packages/core/src/lib/floating/floating.component.scss @@ -9,4 +9,5 @@ top: 0; left: 0; z-index: 999; + will-change: left, top; } diff --git a/packages/core/src/lib/floating/floating.component.ts b/packages/core/src/lib/floating/floating.component.ts index 89a0210..8fc3396 100644 --- a/packages/core/src/lib/floating/floating.component.ts +++ b/packages/core/src/lib/floating/floating.component.ts @@ -1,6 +1,7 @@ import { AfterViewInit, booleanAttribute, + ChangeDetectionStrategy, Component, computed, DoCheck, @@ -41,7 +42,8 @@ import { isServer } from '../injections'; PlatformService ], templateUrl: './floating.component.html', - styleUrl: './floating.component.scss' + styleUrl: './floating.component.scss', + changeDetection: ChangeDetectionStrategy.OnPush }) export class FloatingComponent implements AfterViewInit, OnChanges, DoCheck, OnDestroy { readonly config = inject(NGX_FLOATING_CONFIG);