Skip to content

Commit 962a281

Browse files
committed
fix(IgxGrid): should not throw an error when you copy data in IE11 #8176
1 parent bd4d87c commit 962a281

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
766766
const dragMode = this.selectionService.pointerEnter(this.selectionNode, event);
767767
if (dragMode) {
768768
this.grid.cdr.detectChanges();
769+
if (isIE()) { this.grid.tbody.nativeElement.focus({ preventScroll: true }); }
769770
}
770771
}
771772

@@ -779,6 +780,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
779780
this.grid.navigation.activeNode.gridID !== this.gridID))) { return; }
780781
if (this.selectionService.pointerUp(this.selectionNode, this.grid.onRangeSelection)) {
781782
this.grid.cdr.detectChanges();
783+
if (isIE()) { this.grid.tbody.nativeElement.focus({ preventScroll: true }); }
782784
}
783785
this._updateCRUDStatus();
784786
}

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,6 +2928,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
29282928
_setupListeners() {
29292929
const destructor = takeUntil<any>(this.destroy$);
29302930
fromEvent(this.nativeElement, 'focusout').pipe(filter(() => !!this.navigation.activeNode), destructor).subscribe((event) => {
2931+
if (this.selectionService.dragMode && isIE()) { return; }
29312932
if (!this.crudService.cell && !!this.navigation.activeNode && (event.target === this.tbody.nativeElement &&
29322933
this.navigation.activeNode.row >= 0 && this.navigation.activeNode.row < this.dataView.length)
29332934
|| (event.target === this.theadRow.nativeElement && this.navigation.activeNode.row === -1)
@@ -5739,21 +5740,12 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
57395740
}
57405741
}
57415742

5742-
/**
5743-
* @hidden @internal
5744-
*/
5745-
copyHandlerIE() {
5746-
if (isIE()) {
5747-
this.copyHandler(null, true);
5748-
}
5749-
}
5750-
57515743
/**
57525744
* @hidden
57535745
* @internal
57545746
*/
5755-
public copyHandler(event, ie11 = false) {
5756-
if (!this.clipboardOptions.enabled || this.crudService.inEditMode) {
5747+
public copyHandler(event) {
5748+
if (!this.clipboardOptions.enabled || this.crudService.inEditMode || (!isIE() && event.type === 'keydown')) {
57575749
return;
57585750
}
57595751

@@ -5772,7 +5764,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
57725764
result = result.substring(result.indexOf('\n') + 1);
57735765
}
57745766

5775-
if (ie11) {
5767+
if (isIE()) {
57765768
(window as any).clipboardData.setData('Text', result);
57775769
return;
57785770
}

0 commit comments

Comments
 (0)