Skip to content

Commit 72d1839

Browse files
authored
Merge pull request #8452 from IgniteUI/ddincheva/clipboardIE-10.1
Fix error when copy data in IE11 - 10.1.x
2 parents b595bd1 + 015df44 commit 72d1839

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
@@ -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
}

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)