From: Alexander Ebert Date: Sat, 10 Apr 2021 12:35:53 +0000 (+0200) Subject: Work-around for the scroll position when inserting quotes on iOS X-Git-Tag: 5.3.6~20 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=773d6ec4a4c8652008f8f60e4a5ab25653b5e6f8;p=GitHub%2FWoltLab%2FWCF.git Work-around for the scroll position when inserting quotes on iOS --- diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index f8cf41363b..ed4843597d 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -2084,7 +2084,19 @@ if (COMPILER_TARGET_DEFAULT) { // close dialog if (event !== null) { - this._dialog.wcfDialog('close'); + require(["WoltLabSuite/Core/Environment"], (function (Environment) { + var callback = (function () { + this._dialog.wcfDialog("close"); + }).bind(this); + + // Slightly delay the closing of the overlay, preventing some unexpected + // changes to the scroll position on iOS. + if (Environment.platform() === "ios") { + window.setTimeout(callback, 100); + } else { + callback(); + } + }.bind(this))); } },