From afe41b9134fc274e5287c9d0b141ccb547574966 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 26 Aug 2013 21:23:58 +0000 Subject: [PATCH] TinyMCE: fix editor focus issues after ontouchstart event on the parent document in iOS Safari. Fixes #25131 for 3.7. git-svn-id: https://develop.svn.wordpress.org/trunk@25132 602fd350-edb4-49c9-b593-d223f7449a82 --- .../js/tinymce/plugins/wordpress/editor_plugin_src.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js b/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js index 653eb7c8b2..13eae82d1a 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js @@ -228,6 +228,16 @@ o.content = o.content.replace(/

(
|\u00a0|\uFEFF)?<\/p>/g, '

 

'); }); + // Fix bug in iOS Safari where it's impossible to type after a touchstart event on the parent document. + // Happens after zooming in or out while the keyboard is open. See #25131. + if ( tinymce.isIOS5 ) { + ed.onKeyDown.add( function() { + if ( document.activeElement == document.body ) { + ed.getWin().focus(); + } + }); + } + ed.onSaveContent.add(function(ed, o) { // If editor is hidden, we just want the textarea's value to be saved if ( ed.isHidden() )