From 773d6ec4a4c8652008f8f60e4a5ab25653b5e6f8 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 10 Apr 2021 14:35:53 +0200 Subject: [PATCH] Work-around for the scroll position when inserting quotes on iOS --- wcfsetup/install/files/js/WCF.Message.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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))); } }, -- 2.20.1