[SSE mobile] Fix bug 51623

This commit is contained in:
JuliaSvinareva 2021-08-04 14:12:20 +03:00
parent cb10778723
commit ef74be1d0e
3 changed files with 28 additions and 9 deletions

View file

@ -376,9 +376,16 @@ class MainController extends Component {
const storeFocusObjects = this.props.storeFocusObjects;
this.api.asc_registerCallback('asc_onEditCell', (state) => {
const isFormula = state === Asc.c_oAscCellEditorState.editFormula;
if (storeFocusObjects.editFormulaMode !== isFormula) {
storeFocusObjects.setEditFormulaMode(isFormula);
if (state == Asc.c_oAscCellEditorState.editStart || state == Asc.c_oAscCellEditorState.editEnd) {
const isEditCell = state === Asc.c_oAscCellEditorState.editStart;
if (storeFocusObjects.isEditCell !== isEditCell) {
storeFocusObjects.setEditCell(isEditCell);
}
} else {
const isFormula = state === Asc.c_oAscCellEditorState.editFormula;
if (storeFocusObjects.editFormulaMode !== isFormula) {
storeFocusObjects.setEditFormulaMode(isFormula);
}
}
});
}

View file

@ -10,8 +10,12 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn
const appOptions = props.storeAppOptions;
const isDisconnected = props.users.isDisconnected;
const isObjectLocked = props.storeFocusObjects.isLocked;
const editFormulaMode = props.storeFocusObjects.editFormulaMode;
const storeFocusObjects = props.storeFocusObjects;
const isObjectLocked = storeFocusObjects.isLocked;
const isEditCell = storeFocusObjects.isEditCell;
const editFormulaMode = storeFocusObjects.editFormulaMode;
const displayCollaboration = props.users.hasEditUsers || appOptions.canViewComments;
const docTitle = props.storeSpreadsheetInfo.dataDoc ? props.storeSpreadsheetInfo.dataDoc.title : '';
@ -141,11 +145,11 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn
onUndo={onUndo}
onRedo={onRedo}
disabledControls={disabledControls}
disabledEditControls={disabledEditControls || isObjectLocked || editFormulaMode}
disabledEditControls={disabledEditControls || isObjectLocked || editFormulaMode || isEditCell}
disabledSearch={editFormulaMode}
disabledSettings={disabledSettings || editFormulaMode}
disabledSettings={disabledSettings || editFormulaMode || isEditCell}
displayCollaboration={displayCollaboration}
disabledCollaboration={editFormulaMode}
disabledCollaboration={editFormulaMode || isEditCell}
showEditDocument={showEditDocument}
onEditDocument={onEditDocument}
isDisconnected={isDisconnected}

View file

@ -17,7 +17,9 @@ export class storeFocusObjects {
isLocked: observable,
setIsLocked: action,
editFormulaMode: observable,
setEditFormulaMode: action
setEditFormulaMode: action,
isEditCell: observable,
setEditCell: action
});
}
@ -114,4 +116,10 @@ export class storeFocusObjects {
this.editFormulaMode = value;
}
isEditCell = false;
setEditCell(value) {
this.isEditCell = value;
}
}