Skip to content

Commit 889b424

Browse files
authored
Merge pull request #8451 from IgniteUI/ddincheva/clipboardIE-10.2
Fix error when copy data in IE11 - 10.2.x
2 parents 5ce97ee + c153e00 commit 889b424

File tree

5 files changed

+9
-15
lines changed

5 files changed

+9
-15
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
@@ -795,6 +795,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
795795
const dragMode = this.selectionService.pointerEnter(this.selectionNode, event);
796796
if (dragMode) {
797797
this.grid.cdr.detectChanges();
798+
if (isIE()) { this.grid.tbody.nativeElement.focus({ preventScroll: true }); }
798799
}
799800
}
800801

@@ -808,6 +809,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
808809
this.grid.navigation.activeNode.gridID !== this.gridID))) { return; }
809810
if (this.selectionService.pointerUp(this.selectionNode, this.grid.onRangeSelection)) {
810811
this.grid.cdr.detectChanges();
812+
if (isIE()) { this.grid.tbody.nativeElement.focus({ preventScroll: true }); }
811813
}
812814
}
813815

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2984,6 +2984,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
29842984
_setupListeners() {
29852985
const destructor = takeUntil<any>(this.destroy$);
29862986
fromEvent(this.nativeElement, 'focusout').pipe(filter(() => !!this.navigation.activeNode), destructor).subscribe((event) => {
2987+
if (this.selectionService.dragMode && isIE()) { return; }
29872988
if (!this.crudService.cell &&
29882989
!!this.navigation.activeNode &&
29892990
((event.target === this.tbody.nativeElement && this.navigation.activeNode.row >= 0 &&
@@ -5902,21 +5903,12 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
59025903
}
59035904
}
59045905

5905-
/**
5906-
* @hidden @internal
5907-
*/
5908-
copyHandlerIE() {
5909-
if (isIE()) {
5910-
this.copyHandler(null, true);
5911-
}
5912-
}
5913-
59145906
/**
59155907
* @hidden
59165908
* @internal
59175909
*/
5918-
public copyHandler(event, ie11 = false) {
5919-
if (!this.clipboardOptions.enabled || this.crudService.cellInEditMode) {
5910+
public copyHandler(event) {
5911+
if (!this.clipboardOptions.enabled || this.crudService.cellInEditMode || (!isIE() && event.type === 'keydown')) {
59205912
return;
59215913
}
59225914

@@ -5935,7 +5927,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
59355927
result = result.substring(result.indexOf('\n') + 1);
59365928
}
59375929

5938-
if (ie11) {
5930+
if (isIE()) {
59395931
(window as any).clipboardData.setData('Text', result);
59405932
return;
59415933
}

projects/igniteui-angular/src/lib/grids/grid/grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<div class="igx-grid__thead-thumb" [hidden]='!hasVerticalScroll()' [style.width.px]="scrollSize"></div>
9999
</div>
100100

101-
<div igxGridBody (keydown.control.c)="copyHandlerIE()" (copy)="copyHandler($event)" class="igx-grid__tbody">
101+
<div igxGridBody (keydown.control.c)="copyHandler($event)" (copy)="copyHandler($event)" class="igx-grid__tbody">
102102
<div class="igx-grid__tbody-content" tabindex="0" [attr.aria-activedescendant]="activeDescendant" (keydown)="navigation.handleNavigation($event)" (focus)="navigation.focusTbody($event)"
103103
role="rowgroup" (onDragStop)="selectionService.dragMode = $event" (scroll)='preventContainerScroll($event)'
104104
(onDragScroll)="dragScroll($event)" [igxGridDragSelect]="selectionService.dragMode"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<div class="igx-grid__thead-thumb" [hidden]='!hasVerticalScroll()' [style.width.px]="scrollSize"></div>
8383
</div>
8484

85-
<div igxGridBody (keydown.control.c)="copyHandlerIE()" (copy)="copyHandler($event)" class="igx-grid__tbody">
85+
<div igxGridBody (keydown.control.c)="copyHandler($event)" (copy)="copyHandler($event)" class="igx-grid__tbody">
8686
<div class="igx-grid__tbody-content" tabindex="0" (focus)="navigation.focusTbody($event)" [attr.aria-activedescendant]="activeDescendant"
8787
(keydown)="navigation.handleNavigation($event)" (onDragStop)="selectionService.dragMode = $event"
8888
(onDragScroll)="dragScroll($event)" [igxGridDragSelect]="selectionService.dragMode" role="rowgroup"

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
id="right" class="igx-grid__scroll-on-drag-right"></span>
6565
</div>
6666

67-
<div igxGridBody (keydown.control.c)="copyHandlerIE()" (copy)="copyHandler($event)" class="igx-grid__tbody">
67+
<div igxGridBody (keydown.control.c)="copyHandler($event)" (copy)="copyHandler($event)" class="igx-grid__tbody">
6868
<div class="igx-grid__tbody-content" tabindex="0" (focus)="navigation.focusTbody($event)" [attr.aria-activedescendant]="activeDescendant" (keydown)="navigation.handleNavigation($event)" role="rowgroup" (onDragStop)="selectionService.dragMode = $event"
6969
(onDragScroll)="dragScroll($event)" [igxGridDragSelect]="selectionService.dragMode"
7070
[style.height.px]='totalHeight' [style.width.px]='calcWidth' #tbody (scroll)='preventContainerScroll($event)'>

0 commit comments

Comments
 (0)