Skip to content

Commit 775b3f7

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

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
@@ -789,6 +789,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
789789
const dragMode = this.selectionService.pointerEnter(this.selectionNode, event);
790790
if (dragMode) {
791791
this.grid.cdr.detectChanges();
792+
if (isIE()) { this.grid.tbody.nativeElement.focus({ preventScroll: true }); }
792793
}
793794
}
794795

@@ -802,6 +803,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
802803
this.grid.navigation.activeNode.gridID !== this.gridID))) { return; }
803804
if (this.selectionService.pointerUp(this.selectionNode, this.grid.onRangeSelection)) {
804805
this.grid.cdr.detectChanges();
806+
if (isIE()) { this.grid.tbody.nativeElement.focus({ preventScroll: true }); }
805807
}
806808
this._updateCRUDStatus();
807809
}

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,6 +2847,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
28472847
_setupListeners() {
28482848
const destructor = takeUntil<any>(this.destroy$);
28492849
fromEvent(this.nativeElement, 'focusout').pipe(filter(() => !!this.navigation.activeNode), destructor).subscribe((event) => {
2850+
if (this.selectionService.dragMode && isIE()) { return; }
28502851
if (!this.crudService.cell && !!this.navigation.activeNode && (event.target === this.tbody.nativeElement &&
28512852
this.navigation.activeNode.row >= 0 && this.navigation.activeNode.row < this.dataView.length)
28522853
|| (event.target === this.theadRow.nativeElement && this.navigation.activeNode.row === -1)
@@ -5677,21 +5678,12 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
56775678
}
56785679
}
56795680

5680-
/**
5681-
* @hidden @internal
5682-
*/
5683-
copyHandlerIE() {
5684-
if (isIE()) {
5685-
this.copyHandler(null, true);
5686-
}
5687-
}
5688-
56895681
/**
56905682
* @hidden
56915683
* @internal
56925684
*/
5693-
public copyHandler(event, ie11 = false) {
5694-
if (!this.clipboardOptions.enabled || this.crudService.inEditMode) {
5685+
public copyHandler(event) {
5686+
if (!this.clipboardOptions.enabled || this.crudService.inEditMode || (!isIE() && event.type === 'keydown')) {
56955687
return;
56965688
}
56975689

@@ -5710,7 +5702,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
57105702
result = result.substring(result.indexOf('\n') + 1);
57115703
}
57125704

5713-
if (ie11) {
5705+
if (isIE()) {
57145706
(window as any).clipboardData.setData('Text', result);
57155707
return;
57165708
}

0 commit comments

Comments
 (0)