diff --git a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx index 9455ee9e0..3a03a769d 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx @@ -22,6 +22,7 @@ const StatusbarController = inject('sheets', 'storeFocusObjects', 'users')(obser api.asc_registerCallback('asc_onChangeProtectWorkbook', () => { sheets.setProtectedWorkbook(api.asc_isProtectedWorkbook()); }); + api.asc_registerCallback('asc_onEditCell', onApiEditCell); api.asc_registerCallback('asc_onSheetsChanged', onApiSheetsChanged); api.asc_registerCallback('asc_onActiveSheetChanged', onApiActiveSheetChanged); api.asc_registerCallback('asc_onHidePopMenu', onApiHideTabContextMenu); @@ -32,6 +33,11 @@ const StatusbarController = inject('sheets', 'storeFocusObjects', 'users')(obser Common.Notifications.on('api:disconnect', onApiDisconnect); }); + const onApiEditCell = state => { + let isDisable = state !== Asc.c_oAscCellEditorState.editEnd; + sheets.setDisabledEditSheet(isDisable); + } + const onApiDisconnect = () => { users.resetDisconnected(true); } @@ -127,6 +133,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props => const isEdit = storeAppOptions.isEdit; const isDisconnected = users.isDisconnected; const isProtectedWorkbook = sheets.isProtectedWorkbook; + const isDisabledEditSheet = sheets.isDisabledEditSheet; useEffect(() => { const on_main_view_click = e => { @@ -184,7 +191,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props => if (index == api.asc_getActiveWorksheetIndex()) { if (!opened) { - if (isEdit && !isDisconnected && !model.locked && !isProtectedWorkbook) { + if (isEdit && !isDisconnected && !model.locked && !isProtectedWorkbook && !isDisabledEditSheet) { api.asc_closeCellEditor(); f7.popover.open('#idx-tab-context-menu-popover', target); } diff --git a/apps/spreadsheeteditor/mobile/src/store/sheets.js b/apps/spreadsheeteditor/mobile/src/store/sheets.js index e11964002..3caa203da 100644 --- a/apps/spreadsheeteditor/mobile/src/store/sheets.js +++ b/apps/spreadsheeteditor/mobile/src/store/sheets.js @@ -39,7 +39,10 @@ export class storeWorksheets { setProtectedWorkbook: action, wsProps: observable, - setWsProps: action + setWsProps: action, + + isDisabledEditSheet: observable, + setDisabledEditSheet: action }); this.sheets = []; } @@ -110,4 +113,9 @@ export class storeWorksheets { setWsLock(value) { this.wsLock = value; } + + isDisabledEditSheet; + setDisabledEditSheet(value) { + this.isDisabledEditSheet = value; + } } diff --git a/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx index f31277e63..20685bd5b 100644 --- a/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx @@ -20,12 +20,13 @@ const StatusbarView = inject('storeAppOptions', 'sheets', 'users')(observer(prop const isProtectedWorkbook = sheets.isProtectedWorkbook; const isEdit = storeAppOptions.isEdit; const isDisconnected = users.isDisconnected; + const isDisabledEditSheet = sheets.isDisabledEditSheet; return (
- +