* 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}
()
| 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`. |
no test coverage detected