Skip to content

Commit 969aee5

Browse files
authored
Merge branch 'master' into update-10-1
2 parents d71225d + f7ab347 commit 969aee5

File tree

4 files changed

+424
-4
lines changed

4 files changed

+424
-4
lines changed

projects/igniteui-angular/src/lib/grids/cell.component.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,10 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
756756
* @internal
757757
*/
758758
pointerenter = (event: PointerEvent) => {
759+
const isHierarchicalGrid = this.grid.nativeElement.tagName.toLowerCase() === 'igx-hierarchical-grid';
760+
if (isHierarchicalGrid && (!this.grid.navigation.activeNode.gridID || this.grid.navigation.activeNode.gridID !== this.gridID)) {
761+
return;
762+
}
759763
const dragMode = this.selectionService.pointerEnter(this.selectionNode, event);
760764
if (dragMode) {
761765
this.grid.cdr.detectChanges();
@@ -767,7 +771,9 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
767771
* @internal
768772
*/
769773
pointerup = (event: PointerEvent) => {
770-
if (!isLeftClick(event)) { return; }
774+
const isHierarchicalGrid = this.grid.nativeElement.tagName.toLowerCase() === 'igx-hierarchical-grid';
775+
if (!isLeftClick(event) || (isHierarchicalGrid && (!this.grid.navigation.activeNode.gridID ||
776+
this.grid.navigation.activeNode.gridID !== this.gridID))) { return; }
771777
if (this.selectionService.pointerUp(this.selectionNode, this.grid.onRangeSelection)) {
772778
this.grid.cdr.detectChanges();
773779
}

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-cell.component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ export class IgxHierarchicalGridCellComponent extends IgxGridCellComponent imple
4545
// TODO: Extend the new selection service to avoid complete traversal
4646
_clearAllHighlights() {
4747
[this._rootGrid, ...this._rootGrid.getChildGrids(true)].forEach(grid => {
48-
grid.selectionService.clear();
4948
if (grid !== this.grid && grid.navigation.activeNode) {
5049
grid.navigation.clearActivation();
50+
grid.selectionService.initKeyboardState();
51+
grid.selectionService.clear();
5152
}
5253

5354
grid.selectionService.activeElement = null;
@@ -79,6 +80,7 @@ export class IgxHierarchicalGridCellComponent extends IgxGridCellComponent imple
7980
const parentRowID = parentGrid.hgridAPI.getParentRowId(childGrid);
8081
parentGrid.highlightedRowID = parentRowID;
8182
}
83+
this.grid.navigation.activeNode.gridID = this.gridID;
8284
super.activate(event);
8385
}
8486
}

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid-navigation.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ export class IgxHierarchicalGridNavigationService extends IgxGridNavigationServi
240240
const nextColumnIndex = columnIndex <= lastVisibleIndex ? columnIndex : lastVisibleIndex;
241241
this._pendingNavigation = true;
242242
const cbFunc = (args) => {
243-
args.target.grid.tbody.nativeElement.focus();
244243
this._pendingNavigation = false;
245244
cb(args);
245+
args.target.grid.tbody.nativeElement.focus();
246246
};
247247
this.grid.parent.navigation.navigateInBody(targetRowIndex, nextColumnIndex, cbFunc);
248248
}

0 commit comments

Comments
 (0)