Merge pull request #157 from shariquerik/keyboard-integration-fix

This commit is contained in:
Shariq Ansari 2022-06-08 19:57:17 +05:30 committed by GitHub
commit b4428639cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -520,9 +520,12 @@ export default class CellManager {
} }
promise = valuePromise.then((value) => { promise = valuePromise.then((value) => {
const done = editor.setValue(value, rowIndex, col);
const oldValue = this.getCell(colIndex, rowIndex).content; const oldValue = this.getCell(colIndex, rowIndex).content;
if (oldValue === value) return false;
const done = editor.setValue(value, rowIndex, col);
// update cell immediately // update cell immediately
this.updateCell(colIndex, rowIndex, value); this.updateCell(colIndex, rowIndex, value);
$cell.focus(); $cell.focus();
@ -643,7 +646,7 @@ export default class CellManager {
} }
focusCellInDirection(direction) { focusCellInDirection(direction) {
if (!this.$focusedCell) { if (!this.$focusedCell || (this.$editingCell && ['left', 'right', 'up', 'down'].includes(direction))) {
return false; return false;
} else if (this.$editingCell && ['tab', 'shift+tab'].includes(direction)) { } else if (this.$editingCell && ['tab', 'shift+tab'].includes(direction)) {
this.deactivateEditing(); this.deactivateEditing();