Umesh C
Umesh C

Reputation: 25

Copying values from ag-grid cell (text selection) not working in chrome. - Angular

I tried following approach to solve this issue , it works with FF but not with Chrome.

  ::ng-deep div.ag-cell-value {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor:auto;
  }

Text selecting randomly even from other cells in chrome check below,

i selected only one cell here

Please check the issue by adding this css to below standard template , https://stackblitz.com/edit/ag-grid-angular-hello-world

Upvotes: 0

Views: 7458

Answers (3)

Shyam
Shyam

Reputation: 412

You may try below if you are using community edition,

::ng-deep .ag-unselectable {
   -moz-user-select: text;
   -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

for Enterprise edition you may check - Clipboard Feature

Upvotes: 1

Naime Ahmed
Naime Ahmed

Reputation: 1

If you want to use a regular text selection as if the grid were a regular table, set enableCellTextSelection=true and ensureDomOrder=true in the gridOptions.

https://www.ag-grid.com/angular-data-grid/selection-overview/

Upvotes: 0

Guilherme Lopes
Guilherme Lopes

Reputation: 4760

Instead of using CSS, have you tried using the enableCellTextSelection option?

<ag-grid-angular 
    style="width: 500px; height: 200px;" 
    class="ag-theme-alpine"
    enableCellTextSelection="true"
    [rowData]="rowData" 
    [columnDefs]="columnDefs">
</ag-grid-angular>

Upvotes: 6

Related Questions