Skip to content

Commit dbc962b

Browse files
authored
Merge pull request #8453 from IgniteUI/ddincheva/clipboardIE-9.1
Fix error when copy data in IE11 - 9.1.x
2 parents 0073c45 + 531ebe3 commit dbc962b

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

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)