From c09d21bcf5af545abb7fa33521e99b7bc44ad174 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Mon, 25 Nov 2024 15:15:45 +0300 Subject: [PATCH] Fix bug with focus in mobile version --- cell/view/EventsController.js | 2 ++ common/Scrolls/mobileTouchManagerBase.js | 10 ++++++++++ pdf/src/viewer.js | 3 +++ slide/Drawing/HtmlPage.js | 3 +++ word/Drawing/HtmlPage.js | 3 +++ 5 files changed, 21 insertions(+) diff --git a/cell/view/EventsController.js b/cell/view/EventsController.js index 4a9fb126d2..a0715ee942 100644 --- a/cell/view/EventsController.js +++ b/cell/view/EventsController.js @@ -1642,6 +1642,8 @@ touchManager.stopTouchingInProcess(); return res; } + if (touchManager) + touchManager.checkMouseFocus(e); var t = this; asc["editor"].checkInterfaceElementBlur(); diff --git a/common/Scrolls/mobileTouchManagerBase.js b/common/Scrolls/mobileTouchManagerBase.js index 14d1a65fd2..4585be17ab 100644 --- a/common/Scrolls/mobileTouchManagerBase.js +++ b/common/Scrolls/mobileTouchManagerBase.js @@ -764,6 +764,16 @@ return true; }; + CMobileTouchManagerBase.prototype.checkMouseFocus = function(e) + { + // mobile version does not get focus with mouse events + if (this.Api.isMobileVersion && e && "mouse" === e.pointerType) + { + if (AscCommon.g_inputContext) + AscCommon.g_inputContext.setInterfaceEnableKeyEvents(true); + } + }; + CMobileTouchManagerBase.prototype.checkTouchEvent = function(e) { if (!e) diff --git a/pdf/src/viewer.js b/pdf/src/viewer.js index 270d540e94..a53559491a 100644 --- a/pdf/src/viewer.js +++ b/pdf/src/viewer.js @@ -1990,6 +1990,9 @@ return res; } + if (oThis.touchManager) + oThis.touchManager.checkMouseFocus(e); + oThis.isFocusOnThumbnails = false; AscCommon.stopEvent(e); diff --git a/slide/Drawing/HtmlPage.js b/slide/Drawing/HtmlPage.js index 11d4332c95..e5c922b9b0 100644 --- a/slide/Drawing/HtmlPage.js +++ b/slide/Drawing/HtmlPage.js @@ -3295,6 +3295,9 @@ function CEditorPage(api) return res; } + if (oThis.MobileTouchManager) + oThis.MobileTouchManager.checkMouseFocus(e); + oThis.m_oApi.checkInterfaceElementBlur(); oThis.m_oApi.checkLastWork(); diff --git a/word/Drawing/HtmlPage.js b/word/Drawing/HtmlPage.js index 7e305a5c26..79479c4765 100644 --- a/word/Drawing/HtmlPage.js +++ b/word/Drawing/HtmlPage.js @@ -1729,6 +1729,9 @@ function CEditorPage(api) return res; } + if (oThis.MobileTouchManager) + oThis.MobileTouchManager.checkMouseFocus(e); + oThis.m_oApi.checkInterfaceElementBlur(); oThis.m_oApi.checkLastWork();