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