Search code examples
cssangularag-gridag-grid-angular

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


Solution

  • 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>