MCPcopy Create free account
hub / github.com/handsontable/handsontable / isCellEditable

Method isCellEditable

handsontable/src/editorManager.ts:266–292  ·  view source on GitHub ↗

* Checks if the currently selected cell (pointed by selection highlight coords) is editable. * Editable cell is when: * - the cell has defined an editor type; * - the cell is not marked as read-only; * - the cell is not hidden. * * @private * @returns {boolean}

()

Source from the content-addressed store, hash-verified

264 * @returns {boolean}
265 */
266 isCellEditable() {
267 const selection = this.hot.getSelectedRangeActive();
268
269 if (!selection) {
270 return false;
271 }
272
273 const editorClass = this.hot.getCellEditor(this.cellProperties);
274 const { row, col } = selection.highlight;
275
276 if (row === null || col === null) {
277 return false;
278 }
279
280 const {
281 rowIndexMapper,
282 columnIndexMapper
283 } = this.hot;
284 const isCellHidden = rowIndexMapper.isHidden(this.hot.toPhysicalRow(row)) ||
285 columnIndexMapper.isHidden(this.hot.toPhysicalColumn(col));
286
287 if (this.cellProperties.readOnly || !editorClass || isCellHidden) {
288 return false;
289 }
290
291 return true;
292 }
293
294 /**
295 * Controls selection's behavior after clicking `Enter`.

Callers 2

prepareEditorMethod · 0.95
openEditorMethod · 0.95

Calls 5

getCellEditorMethod · 0.80
toPhysicalRowMethod · 0.80
toPhysicalColumnMethod · 0.80
isHiddenMethod · 0.45

Tested by

no test coverage detected