-
Notifications
You must be signed in to change notification settings - Fork 160
fix(igxGrid): Hide overlays on scroll + special handling for row edit… #17220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 21.2.x
Are you sure you want to change the base?
Changes from 5 commits
3676400
449a15c
09d1cd9
5acdcab
a66b6b1
3000d73
1d95dcb
3eb2868
b1987b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) => { | ||
|
|
@@ -3747,6 +3747,16 @@ export abstract class IgxGridBaseDirective implements GridType, | |
| } | ||
| } | ||
| this.notifyChanges(true); | ||
| if (this.rowEditable && this.crudService.rowInEditMode && this.rowEditingOverlay && | ||
| this.rowEditingOverlay.collapsed) { | ||
| // connected to DOM, row is in edit mode, but overlay is closed - reopen. | ||
| this.openRowOverlay(this.crudService.rowInEditMode.id); | ||
| } | ||
| } | ||
|
|
||
| if (!this.nativeElement.isConnected && this.rowEditable && this.crudService.rowInEditMode && this.rowEditingOverlay) { | ||
| // disconnected from DOM (possibly cached) & row was in edit mode - close overlay. | ||
| this.closeRowEditingOverlay(); | ||
| } | ||
| }); | ||
| }); | ||
|
|
@@ -3766,22 +3776,23 @@ export abstract class IgxGridBaseDirective implements GridType, | |
| this.overlayService.opened.pipe(destructor).subscribe((event) => { | ||
| const overlaySettings = this.overlayService.getOverlayById(event.id)?.settings; | ||
|
|
||
| // do not hide the advanced filtering overlay on scroll | ||
| if (this._advancedFilteringOverlayId === event.id) { | ||
| // this sets focus to query builder button for some reason... | ||
| if (this._advancedFilteringOverlayId === event.id) { | ||
| const instance = event.componentRef.instance as IgxAdvancedFilteringDialogComponent; | ||
| if (instance) { | ||
| instance.lastActiveNode = this.navigation.activeNode; | ||
| instance.queryBuilder.setAddButtonFocus(); | ||
| } | ||
| return; | ||
|
damyanpetev marked this conversation as resolved.
|
||
| } | ||
|
|
||
| // 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; | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These rows should really not need additional changes, just the outlet check below;
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just to match the existing behavior. The row edit overlay did not close on scroll in previous versions. There is just handling to reposition it. |
||
|
|
||
| if (overlaySettings?.outlet === this.outlet && this.overlayIDs.indexOf(event.id) === -1) { | ||
| // check whole grid, since some overlays like the advanced filtering, are outside the body. | ||
| const isInGrid = this.nativeElement.contains(overlaySettings?.target as Node); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check overlaySettings?.target is Node instead of cast, as |
||
| if (isInGrid && this.overlayIDs.indexOf(event.id) === -1) { | ||
|
MayaKirova marked this conversation as resolved.
Outdated
MayaKirova marked this conversation as resolved.
|
||
| this.overlayIDs.push(event.id); | ||
| } | ||
|
MayaKirova marked this conversation as resolved.
Outdated
|
||
| }); | ||
|
|
@@ -4047,8 +4058,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; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.