Skip to content

Commit

Permalink
refactor(cdk-experimental/popover-edit): inconsistency in Angular 19
Browse files Browse the repository at this point in the history
Fixes some inconsistencies that showed up in the popover edit tests after the update to v19.
  • Loading branch information
crisbeto committed Aug 29, 2024
1 parent b0fd3ea commit 181164e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cdk-experimental/popover-edit/table-directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from '@angular/core';
import {fromEvent, fromEventPattern, merge, Subject} from 'rxjs';
import {
debounceTime,
filter,
map,
mapTo,
Expand Down Expand Up @@ -136,10 +137,12 @@ 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),
filter(([_, activeRow]) => activeRow == null),
filter(([_, activeRow]) => activeRow === null),
map(() => element.querySelectorAll(ROW_SELECTOR)),
share(),
takeUntil(this.destroyed),
Expand Down

0 comments on commit 181164e

Please sign in to comment.