SlickGrid icon indicating copy to clipboard operation
SlickGrid copied to clipboard

multiSelect: false option should disable SHIFT + Arrow key too

Open gsanta opened this issue 10 years ago • 1 comments

When using multiSelect: false, the SHIFT + mouse click and CTRL + mouse click are disabled, but you can multi select with SHIFT + Arrow down/up. I think it is a bug.

gsanta avatar Jun 11 '14 10:06 gsanta

This is not the most elegant fix but

replace the rowselectionmodel line 123

if (active >= 0 && active < _grid.getDataLength()) {
 _grid.scrollRowIntoView(active);
 var tempRanges = rowsToRanges(getRowsRange(top, bottom));
 setSelectedRanges(tempRanges);
}

With the following which updates the top and bottom to the active if multi is false.

if (active >= 0 && active < _grid.getDataLength()) {
    _grid.scrollRowIntoView(active);
    if (!_grid.getOptions().multiSelect) {
        top = active;
        bottom = active;
    }                    
    var tempRanges = rowsToRanges(getRowsRange(top, bottom));
    setSelectedRanges(tempRanges);                    
}

SatanEnglish avatar Jun 08 '17 03:06 SatanEnglish