handsontable
Version:
Handsontable is a JavaScript Data Grid available for React, Angular and Vue.
26 lines (25 loc) • 791 B
JavaScript
;
exports.__esModule = true;
const command = exports.command = {
name: 'extendCellsSelectionToMostInlineEnd',
callback(hot) {
const {
selection,
columnIndexMapper
} = hot;
const {
highlight,
from,
to
} = hot.getSelectedRangeActive();
if (!selection.isSelectedByRowHeader() && !selection.isSelectedByCorner() && highlight.isCell()) {
const column = columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1);
const newFrom = from.clone();
newFrom.col = highlight.col;
selection.markSource('keyboard');
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
selection.setRangeEnd(hot._createCellCoords(to.row, column));
selection.markEndSource();
}
}
};