diff --git a/projects/igniteui-angular/grids/grid/src/grid-base.directive.ts b/projects/igniteui-angular/grids/grid/src/grid-base.directive.ts index 8c8eb802ce1..64485b68d21 100644 --- a/projects/igniteui-angular/grids/grid/src/grid-base.directive.ts +++ b/projects/igniteui-angular/grids/grid/src/grid-base.directive.ts @@ -3717,10 +3717,10 @@ export abstract class IgxGridBaseDirective implements GridType, filter(() => !this._init), throttle(() => this.throttleTime$.pipe( - take(1), - switchMap(time => timer(time, this.throttleScheduler)) + take(1), + switchMap(time => timer(time, this.throttleScheduler)) ) - ), + ), destructor ) .subscribe((event) => { @@ -3767,7 +3767,7 @@ export abstract class IgxGridBaseDirective implements GridType, const overlaySettings = this.overlayService.getOverlayById(event.id)?.settings; // do not hide the advanced filtering overlay on scroll - if (this._advancedFilteringOverlayId === event.id) { + if (this._advancedFilteringOverlayId === event.id) { const instance = event.componentRef.instance as IgxAdvancedFilteringDialogComponent; if (instance) { instance.lastActiveNode = this.navigation.activeNode; @@ -3776,12 +3776,14 @@ export abstract class IgxGridBaseDirective implements GridType, return; } - // do not hide the overlay if it's attached to a row - if (this.rowEditingOverlay?.overlayId === event.id) { + const inRow = (overlaySettings?.target as HTMLElement)?.classList.contains("igx-grid__tr"); + // do not hide the overlay if it's attached to a row on scroll + if (inRow) { return; } - if (overlaySettings?.outlet === this.outlet && this.overlayIDs.indexOf(event.id) === -1) { + const isInGrid = overlaySettings?.target instanceof Node && this.tbody.nativeElement.contains(overlaySettings?.target); + if (isInGrid && this.overlayIDs.indexOf(event.id) === -1) { this.overlayIDs.push(event.id); } }); @@ -4047,8 +4049,8 @@ export abstract class IgxGridBaseDirective implements GridType, const activeRow = this.navigation.activeNode?.row; const selectedCellIndexes = this.selectionService.selection - ? Array.from(this.selectionService.selection.keys()) - : []; + ? Array.from(this.selectionService.selection.keys()) + : []; this._activeRowIndexes = [activeRow, ...selectedCellIndexes]; return this._activeRowIndexes; } diff --git a/projects/igniteui-angular/grids/grid/src/grid-row-editing.spec.ts b/projects/igniteui-angular/grids/grid/src/grid-row-editing.spec.ts index ba77b0bbd7d..e14f52423bc 100644 --- a/projects/igniteui-angular/grids/grid/src/grid-row-editing.spec.ts +++ b/projects/igniteui-angular/grids/grid/src/grid-row-editing.spec.ts @@ -491,6 +491,21 @@ describe('IgxGrid - Row Editing #grid', () => { cell.editMode = false; }); + it('Overlay position: Should keep row editing overlay open on vertical scroll', fakeAsync(() => { + cell = grid.getCellByColumn(0, 'ProductName'); + cell.editMode = true; + fix.detectChanges(); + + expect(grid.rowEditingOverlay.collapsed).toBeFalse(); + + (grid as any).verticalScrollHandler({ target: grid.verticalScrollContainer.getScroll() }); + tick(); + fix.detectChanges(); + + expect(GridFunctions.getRowEditingOverlay(fix)).toBeTruthy(); + expect(grid.rowEditingOverlay.collapsed).toBeFalse(); + })); + it('should end row editing when clearing or applying advanced filter', () => { fix.detectChanges(); const row = grid.gridAPI.get_row_by_index(2); diff --git a/src/app/hierarchical-grid/hierarchical-grid.sample.html b/src/app/hierarchical-grid/hierarchical-grid.sample.html index 81ee690a48f..95a8c73db8a 100644 --- a/src/app/hierarchical-grid/hierarchical-grid.sample.html +++ b/src/app/hierarchical-grid/hierarchical-grid.sample.html @@ -8,7 +8,7 @@

Sample One

@@ -53,9 +53,9 @@

Sample One

- + @@ -66,10 +66,14 @@

Sample One

- + + + + {{ toolbarTitle }} + @@ -79,8 +83,8 @@

Sample One

- - + +
diff --git a/src/app/hierarchical-grid/hierarchical-grid.sample.ts b/src/app/hierarchical-grid/hierarchical-grid.sample.ts index af746d3344c..96394bbd56b 100644 --- a/src/app/hierarchical-grid/hierarchical-grid.sample.ts +++ b/src/app/hierarchical-grid/hierarchical-grid.sample.ts @@ -2,6 +2,7 @@ import { Component, ViewChild, ChangeDetectorRef, AfterViewInit, HostBinding } f import { GridSearchBoxComponent } from '../grid-search-box/grid-search-box.component'; import { IgxRowIslandComponent, + IgxActionStripComponent, IgxHierarchicalGridComponent, IGridCellEventArgs, GridSelectionMode, @@ -16,7 +17,7 @@ import { selector: 'app-hierarchical-grid-sample', styleUrls: ['hierarchical-grid.sample.scss'], templateUrl: 'hierarchical-grid.sample.html', - imports: [GridSearchBoxComponent, IGX_HIERARCHICAL_GRID_DIRECTIVES, IgxIconComponent, IGX_BUTTON_GROUP_DIRECTIVES] + imports: [GridSearchBoxComponent, IGX_HIERARCHICAL_GRID_DIRECTIVES, IgxIconComponent, IGX_BUTTON_GROUP_DIRECTIVES, IgxActionStripComponent] }) export class HierarchicalGridSampleComponent implements AfterViewInit { @HostBinding('style.--ig-size')