Skip to content

Commit c58a10d

Browse files
authored
Merge pull request #8250 from IgniteUI/simeonoff/fix-8023-9.1.x
refactor(grid): do not hide editing row on scroll
2 parents 8064f06 + ba43017 commit c58a10d

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

projects/igniteui-angular/src/lib/directives/toggle/toggle.directive.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,16 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
297297
return info ? info.closeAnimationPlayer : false;
298298
}
299299

300+
/**
301+
* Returns the id of the overlay the content is rendered in.
302+
* ```typescript
303+
* this.myToggle.overlayId;
304+
* ```
305+
*/
306+
public get overlayId() {
307+
return this._overlayId;
308+
}
309+
300310
/**
301311
* Repositions the toggle.
302312
* ```typescript

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2893,6 +2893,8 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
28932893
});
28942894

28952895
this.overlayService.onOpened.pipe(destructor).subscribe((event) => {
2896+
const overlaySettings = this.overlayService.getOverlayById(event.id)?.settings;
2897+
28962898
// do not hide the advanced filtering overlay on scroll
28972899
if (this._advancedFilteringOverlayId === event.id) {
28982900
const instance = event.componentRef.instance as IgxAdvancedFilteringDialogComponent;
@@ -2903,8 +2905,12 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
29032905
return;
29042906
}
29052907

2906-
if (this.overlayService.getOverlayById(event.id)?.settings?.outlet === this.outlet &&
2907-
this.overlayIDs.indexOf(event.id) < 0) {
2908+
// do not hide the overlay if it's attached to a row
2909+
if (this.rowEditingOverlay?.overlayId === event.id) {
2910+
return;
2911+
}
2912+
2913+
if (overlaySettings?.outlet === this.outlet && this.overlayIDs.indexOf(event.id) === -1) {
29082914
this.overlayIDs.push(event.id);
29092915
}
29102916
});

projects/igniteui-angular/src/lib/grids/grid.common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Directive } from '@angular/core';
1+
import { Directive } from '@angular/core';
22
import { ConnectedPositioningStrategy } from '../services/public_api';
33
import { VerticalAlignment, PositionSettings } from '../services/overlay/utilities';
44
import { scaleInVerBottom, scaleInVerTop } from '../animations/main';

0 commit comments

Comments
 (0)