From: Alexander Ebert Date: Thu, 27 Aug 2015 14:16:17 +0000 (+0200) Subject: Work-around for iOS 8 zoom bug on first tap X-Git-Tag: 2.1.7~19^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cc75a15740fcf0b917c956c387bed4da093dbeb5;p=GitHub%2FWoltLab%2FWCF.git Work-around for iOS 8 zoom bug on first tap --- 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);