Skip to content

Commit

Permalink
[se] Fix bug 72491
Browse files Browse the repository at this point in the history
  • Loading branch information
GoshaZotov committed Jan 16, 2025
1 parent 690bc30 commit 022f6d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cell/view/CellEditorView.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ function (window, undefined) {
this.selectionTimer = undefined;
this.enableKeyEvents = true;
this.isTopLineActive = false;
this.openFromTopLine = false;
this.skipTLUpdate = true;
this.loadFonts = false;
this.isOpened = false;
Expand Down Expand Up @@ -332,7 +333,7 @@ function (window, undefined) {
}
this._setOptions(options);
this._cleanLastRangeInfo();
this._updateTopLineActive(true === this.input.isFocused);
this._updateTopLineActive(true === this.input.isFocused, true);

this._updateEditorState();
this._draw();
Expand Down Expand Up @@ -1141,9 +1142,10 @@ function (window, undefined) {
return !range ? {range: null} : {range: range, wsName: wsName};
};

CellEditor.prototype._updateTopLineActive = function (state) {
CellEditor.prototype._updateTopLineActive = function (state, isOpening) {
if (state !== this.isTopLineActive) {
this.isTopLineActive = state;
this.openFromTopLine = isOpening && state;
this.handlers.trigger("updateTopLine", this.isTopLineActive ? c_oAscCellEditorState.editInFormulaBar : c_oAscCellEditorState.editInCell);
}
};
Expand Down
4 changes: 2 additions & 2 deletions cell/view/WorkbookView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1395,9 +1395,9 @@
}, 1000);
}

if (this.isFormulaEditMode && this.isCellEditMode && this.cellEditor && this.cellEditor.isTopLineActive) {
if (this.isFormulaEditMode && this.isCellEditMode && this.cellEditor && this.cellEditor.openFromTopLine) {
/* set focus to the top formula entry line */
this.input.focus();
this.cellEditor.restoreFocus();
}

asc_applyFunction(callback, d);
Expand Down

0 comments on commit 022f6d3

Please sign in to comment.