[se] Fix bug 76532

This commit is contained in:
Igor Zotov
2026-02-21 14:21:14 +03:00
committed by Ilya Kirillov
parent fce23b8c12
commit 679a6d70cc
2 changed files with 20 additions and 7 deletions

View File

@ -426,7 +426,7 @@ function (window, undefined) {
// Reset editor state
t._setEditorState(c_oAscCellEditorState.editEnd);
t.handlers.trigger("closed");
t.handlers.trigger("closed", saveValue);
t.closeAction();
if (callback) {
@ -483,7 +483,7 @@ function (window, undefined) {
// Reset editor state
this._setEditorState(c_oAscCellEditorState.editEnd);
this.handlers.trigger("closed");
this.handlers.trigger("closed", saveValue);
t.closeAction();
if (callback) {

View File

@ -2302,8 +2302,9 @@
return this.closeCellEditor();
};
WorkbookView.prototype._onCloseCellEditor = function() {
WorkbookView.prototype._onCloseCellEditor = function(saveValue) {
var isCellEditMode = this.getCellEditMode();
var isFormulaEditMode = this.isFormulaEditMode;
this.setCellEditMode(false);
if (isCellEditMode) {
@ -2332,7 +2333,9 @@
this.updateTargetForCollaboration();
this.sendCursor();
this.externalSelectionController.sendExternalCloseEditor();
if (isFormulaEditMode) {
this.externalSelectionController.sendExternalCloseEditor(saveValue);
}
};
WorkbookView.prototype._onEmpty = function() {
@ -7613,7 +7616,7 @@
});
window.addEventListener && window.addEventListener('unload', function() {
if (isClosing) {
if (isClosing && oThis.wb.isFormulaEditMode) {
oThis.sendExternalCloseEditor();
}
});
@ -7672,6 +7675,10 @@
return;
}
if (!this.wb.isFormulaEditMode && !this.getExternalFormulaEditMode()) {
return;
}
this.lockSendChangeSelection = true;
if ((!this.getExternalFormulaEditMode() && !this._isEqualEditorState(data)) || !this.supportVisibilityChangeOption) {
this.wb.setFormulaEditMode(true);
@ -7697,10 +7704,16 @@
return;
}
const isExternalFormulaEditMode = this.getExternalFormulaEditMode();
if (!data.isClose && this.wb.isCellEditMode) {
return;
}
this.setExternalFormulaEditMode(!data.isClose ? {id: data.id} : null);
if (this.wb.getCellEditMode() && data.isClose && (isExternalFormulaEditMode || !this.supportVisibilityChangeOption)) {
this.wb.closeCellEditor(!data.saveValue);
if (this.wb.getCellEditMode() && data.isClose && (isExternalFormulaEditMode || this.wb.isFormulaEditMode)) {
var cancelClose = isExternalFormulaEditMode ? true : !data.saveValue;
this.wb.closeCellEditor(cancelClose);
this.clean();
} else if (!this.supportVisibilityChangeOption && !this.wb.getCellEditMode() && !data.isClose) {
this.onOpenCellEditor();