From ff73a6d1fbf6fb59660bc71280a9d1bb8ca23ccc Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 30 Aug 2013 11:10:27 +0100 Subject: [PATCH] MDL-41328 Editor: Work around another iOS issue with TinyMCE We apply this only on touchend and not touchstart or touchmove. The location is not guaranteed until the end of the gesture, and there's no need to keep applying focus on every move. --- lib/editor/tinymce/module.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/editor/tinymce/module.js b/lib/editor/tinymce/module.js index 7ee56f4776f..b86da9d8406 100644 --- a/lib/editor/tinymce/module.js +++ b/lib/editor/tinymce/module.js @@ -68,6 +68,13 @@ M.editor_tinymce.init_editor = function(Y, editorid, options) { ed.contentDocument.addEventListener('keydown', function() { ed.contentWindow.focus(); }); + + // Whenever a touch event is registered against the content document, + // reapply focus. This works around an issue with the location caret not + // being focusable without use of the Loupe. + ed.contentDocument.addEventListener('touchend', function() { + ed.contentWindow.focus(); + }); }); }; } -- 2.43.0