From ef74be1d0e83cd0e1b56411dbfc0341b92e5c296 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Wed, 4 Aug 2021 14:12:20 +0300 Subject: [PATCH] [SSE mobile] Fix bug 51623 --- .../mobile/src/controller/Main.jsx | 13 ++++++++++--- .../mobile/src/controller/Toolbar.jsx | 14 +++++++++----- .../mobile/src/store/focusObjects.js | 10 +++++++++- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index 04ee105a2..12c7b3f83 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -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); + } } }); } diff --git a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx index ec2f9441a..886b728f9 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx @@ -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} diff --git a/apps/spreadsheeteditor/mobile/src/store/focusObjects.js b/apps/spreadsheeteditor/mobile/src/store/focusObjects.js index 1ec486d3e..c16c6a4c5 100644 --- a/apps/spreadsheeteditor/mobile/src/store/focusObjects.js +++ b/apps/spreadsheeteditor/mobile/src/store/focusObjects.js @@ -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; + } + } \ No newline at end of file