From 182ff8103df19598169557cea515de79aebd5dd9 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Fri, 27 Sep 2024 12:02:17 +0300 Subject: [PATCH] Fix input in telegram web view --- common/browser.js | 5 ++++- common/text_input2.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/browser.js b/common/browser.js index 400f8d3b2d..abcc60b74f 100644 --- a/common/browser.js +++ b/common/browser.js @@ -63,7 +63,8 @@ var AscBrowser = { chromeVersion : 70, iosVersion : 13, isAndroidNativeApp : false, - safariVersion : 17004001 + safariVersion : 17004001, + isTelegramWebView : false }; // user agent lower case @@ -177,6 +178,8 @@ AscBrowser.isNeedEmulateUpload = (AscBrowser.userAgent.indexOf("needemulateuploa AscBrowser.isAndroidNativeApp = (AscBrowser.userAgent.indexOf("ascandroidwebview") > -1); +AscBrowser.isTelegramWebView = (typeof TelegramWebviewProxy === "object") ? true : false; + AscBrowser.zoom = 1; AscBrowser.isCustomScaling = function() diff --git a/common/text_input2.js b/common/text_input2.js index ea8a8a4468..2d875f9ef8 100644 --- a/common/text_input2.js +++ b/common/text_input2.js @@ -942,7 +942,7 @@ { _style = ("left:-" + (this.HtmlAreaWidth >> 1) + "px;top:" + (-this.HtmlAreaOffset) + "px;"); _style += "color:transparent;caret-color:transparent;background:transparent;"; - _style += AscCommon.AscBrowser.isAppleDevices ? "font-size:0px;" : "font-size:8px;"; + _style += (AscCommon.AscBrowser.isAppleDevices && !AscCommon.AscBrowser.isTelegramWebView) ? "font-size:0px;" : "font-size:8px;"; } else {