From cc75a15740fcf0b917c956c387bed4da093dbeb5 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 27 Aug 2015 16:16:17 +0200 Subject: [PATCH] Work-around for iOS 8 zoom bug on first tap --- .../files/js/3rdParty/redactor/plugins/wbbcode.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index ac02fb6be6..a924a619c8 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -43,6 +43,16 @@ RedactorPlugins.wbbcode = function() { $(document).trigger('resize'); this.wutil.saveSelection(); + + var editor = this.$editor[0], textarea = this.$textarea[0]; + setTimeout(function() { + if ($.browser.iOS && editor.scrollHeight === 0) { + // work-around for iOS 8 bug causing the browser to zoom in on tap + if (document.activeElement === editor || document.activeElement === textarea) { + document.activeElement.blur(); + } + } + }, 10); }).bind(this); this.opts.pasteBeforeCallback = $.proxy(this.wbbcode._pasteBeforeCallback, this); -- 2.20.1