SlickGrid icon indicating copy to clipboard operation
SlickGrid copied to clipboard

Fix for Cell text content selection in non IE Browsers

Open ptraca opened this issue 13 years ago • 9 comments
trafficstars

Small fix that make it possible to select and copy/past cell text content in non IE browsers. By default text selection within cells is disabled via the enableTextSelectionOnCells = false property. Apparently cell text selection only works correctly in IE - lines 266-271 of file slick.grid.js

    // for usability reasons, all text selection in SlickGrid is disabled
    // with the exception of input and textarea elements (selection must
    // be enabled there so that editors work as expected); note that
    // selection in grid cells (grid body) is already unavailable in
    // all browsers except IE
    disableSelection($headers); // disable all text selection in header (including input and textarea)

I added a change to the handleClick event listener that fix the problem in the other browsers.

ptraca avatar Aug 31 '12 09:08 ptraca

Any status of this change? This worked for me (i.e fixes the issue of not being able to copy content from cells).

bharatn avatar Jan 10 '13 18:01 bharatn

Hi, still waiting for feedback on the pull request or for it to be accepted in to the SlickGrid master branch.

ptraca avatar Jan 11 '13 16:01 ptraca

Please add more details so that I can review it. How exactly is the problem manifested (repro steps)? How is your fix addressing the issue?

mleibman avatar Jan 11 '13 17:01 mleibman

Good stuff man, it solved the issue for me, thanks.

gilboagl avatar Mar 08 '13 20:03 gilboagl

This solved an issue for me. Thanks a ton!

brendangreene avatar Jun 03 '13 22:06 brendangreene

This does however prevent key events from being handled.

brendangreene avatar Jun 04 '13 15:06 brendangreene

I cannot merge this without an explanation of what this fixes and how.

mleibman avatar Jun 13 '13 18:06 mleibman

Great job done.....

dipteshc-nrift avatar Aug 22 '13 16:08 dipteshc-nrift

I am running into this issue too. I would like for my users of my application to be able to select text out of a grid and copy it to the clipboard such as in http://mleibman.github.io/SlickGrid/examples/example1-simple.html. Right now, when I highlight text in any cell using Firefox, the selection immediately disappears. I tried the above patch and it seems to resolve it. Is this the recommended approach or is there a more official fix already merged into SlickGrid?

rbro avatar Sep 10 '13 22:09 rbro