From 7afe2c62fab0bb927fa2e39737f5278da2f03433 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Thu, 16 Mar 2023 18:48:52 +0400 Subject: [PATCH] [DE PE SSE mobile] Fix Bug 53974 --- apps/documenteditor/mobile/src/controller/Main.jsx | 6 +----- apps/documenteditor/mobile/src/controller/Search.jsx | 8 -------- apps/presentationeditor/mobile/src/controller/Main.jsx | 6 +----- apps/presentationeditor/mobile/src/controller/Search.jsx | 8 -------- apps/spreadsheeteditor/mobile/src/controller/Main.jsx | 4 ++-- apps/spreadsheeteditor/mobile/src/controller/Search.jsx | 2 +- 6 files changed, 5 insertions(+), 29 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 3319c14f9a..544151e84a 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -598,14 +598,10 @@ class MainController extends Component { this.api.Resize(); }); - $$(window).on('popover:open popup:open sheet:open actions:open dialog:open', () => { + $$(window).on('popover:open popup:open sheet:open actions:open dialog:open searchbar:enable', () => { this.api.asc_enableKeyEvents(false); }); - $$(window).on('popover:close popup:close sheet:close actions:close dialog:close', () => { - this.api.asc_enableKeyEvents(true); - }); - this.api.asc_registerCallback('asc_onDocumentUpdateVersion', this.onUpdateVersion.bind(this)); this.api.asc_registerCallback('asc_onServerVersion', this.onServerVersion.bind(this)); this.api.asc_registerCallback('asc_onDocumentName', this.onDocumentName.bind(this)); diff --git a/apps/documenteditor/mobile/src/controller/Search.jsx b/apps/documenteditor/mobile/src/controller/Search.jsx index 412a7d7745..cb195e4fef 100644 --- a/apps/documenteditor/mobile/src/controller/Search.jsx +++ b/apps/documenteditor/mobile/src/controller/Search.jsx @@ -94,14 +94,6 @@ const Search = withTranslation()(props => { const { t } = props; const _t = t('Settings', {returnObjects: true}); - useEffect(() => { - if(f7.searchbar.get('.searchbar')?.enabled && Device.phone) { - const api = Common.EditorApi.get(); - $$('.searchbar-input').focus(); - api.asc_enableKeyEvents(false); - } - }, []); - const onSearchQuery = params => { const api = Common.EditorApi.get(); diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx index 4531c83549..91eb8e89df 100644 --- a/apps/presentationeditor/mobile/src/controller/Main.jsx +++ b/apps/presentationeditor/mobile/src/controller/Main.jsx @@ -330,14 +330,10 @@ class MainController extends Component { this.api.Resize(); }); - $$(window).on('popup:open sheet:open actions:open', () => { + $$(window).on('popup:open sheet:open actions:open searchbar:enable', () => { this.api.asc_enableKeyEvents(false); }); - $$(window).on('popup:close sheet:close actions:close', () => { - this.api.asc_enableKeyEvents(true); - }); - this.api.asc_registerCallback('asc_onDocumentContentReady', this.onDocumentContentReady.bind(this)); this.api.asc_registerCallback('asc_onDocumentUpdateVersion', this.onUpdateVersion.bind(this)); this.api.asc_registerCallback('asc_onServerVersion', this.onServerVersion.bind(this)); diff --git a/apps/presentationeditor/mobile/src/controller/Search.jsx b/apps/presentationeditor/mobile/src/controller/Search.jsx index 069e698934..690f264b84 100644 --- a/apps/presentationeditor/mobile/src/controller/Search.jsx +++ b/apps/presentationeditor/mobile/src/controller/Search.jsx @@ -74,14 +74,6 @@ const Search = withTranslation()(props => { const { t } = props; const _t = t('View.Settings', {returnObjects: true}); - useEffect(() => { - if (f7.searchbar.get('.searchbar')?.enabled && Device.phone) { - const api = Common.EditorApi.get(); - $$('.searchbar-input').focus(); - api.asc_enableKeyEvents(false); - } - }); - const onSearchQuery = params => { const api = Common.EditorApi.get(); diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index eacaaae511..00b6e526c5 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -369,11 +369,11 @@ class MainController extends Component { this.api.asc_Resize(); }); - $$(window).on('popover:open popup:open sheet:open actions:open', () => { + $$(window).on('popover:open popup:open sheet:open actions:open searchbar:enable', () => { this.api.asc_enableKeyEvents(false); }); - $$(window).on('popover:close popup:close sheet:close actions:close', () => { + $$(window).on('popover:close popup:close sheet:close actions:close searchbar:disable', () => { this.api.asc_enableKeyEvents(true); }); diff --git a/apps/spreadsheeteditor/mobile/src/controller/Search.jsx b/apps/spreadsheeteditor/mobile/src/controller/Search.jsx index 1df9e4366b..a108f19afe 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Search.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Search.jsx @@ -140,8 +140,8 @@ const Search = withTranslation()(props => { useEffect(() => { if (f7.searchbar.get('.searchbar')?.enabled && Device.phone) { const api = Common.EditorApi.get(); - $$('.searchbar-input').focus(); api.asc_enableKeyEvents(false); + $$('.searchbar-input').focus(); } });