Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slickgrid cell text selection does not work properly in Chrome or Firefox

Tags:

slickgrid

I have set enableTextSelectionOnCells according to SlickGrid and Text Selection.

I am not really happy about it.

Cell text gets selected with a bad behaviour. Sometimes as soon as selection is done, the selection disappears. Only on rare occasions does it work.

Has anyone faced this issue?

I have tried this on Firefox and Chrome.

to reproduce:

  1. git clone [email protected]:mleibman/SlickGrid.git
  2. go to examples folder
  3. edit the example1-simple.html
  4. Add enableTextSelectionOnCells: true in options
  5. Open example1-simple.html in FF/Chrome
  6. Try selecting a cell value

FYI, I am running on Ubuntu if it should make any difference.

like image 872
Ranjith Ramachandra Avatar asked Aug 23 '13 07:08

Ranjith Ramachandra


1 Answers

This problem is already solved on Github. You just have to modify slick.gird.js. Around line number 2270, you just have to add " options.editable && ". Hope this help.

if (!currentEditor) {
    // if this click resulted in some cell child node getting focus,
    // don't steal it back - keyboard events will still bubble up
    // IE9+ seems to default DIVs to tabIndex=0 instead of -1, so check for cell clicks directly.
    if (options.editable && e.target != document.activeElement || $(e.target).hasClass("slick-cell")) {
      setFocus();
    }
  }
like image 173
HeiN Avatar answered Oct 17 '22 08:10

HeiN