From 5bd5be60a2ba8d263ec71bec69d1e14a9bf6ffe2 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 29 Aug 2024 20:47:28 +0200 Subject: [PATCH] refactor(cdk-experimental/popover-edit): inconsistency in Angular 19 Fixes some inconsistencies that showed up in the popover edit tests after the update to v19. --- src/cdk-experimental/popover-edit/table-directives.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cdk-experimental/popover-edit/table-directives.ts b/src/cdk-experimental/popover-edit/table-directives.ts index 58775ee0f8ed..916e55807528 100644 --- a/src/cdk-experimental/popover-edit/table-directives.ts +++ b/src/cdk-experimental/popover-edit/table-directives.ts @@ -21,6 +21,7 @@ import { } from '@angular/core'; import {fromEvent, fromEventPattern, merge, Subject} from 'rxjs'; import { + debounceTime, filter, map, mapTo, @@ -136,6 +137,8 @@ export class CdkEditable implements AfterViewInit, OnDestroy { // or below the table. this._rendered .pipe( + // Avoid some timing inconsistencies since Angular v19. + debounceTime(0), // Optimization: ignore dom changes while focus is within the table as we already // ensure that rows above and below the focused/active row are tabbable. withLatestFrom(this.editEventDispatcher.editingOrFocused),