From 48192f196f9cbc281047666b966b285a0bee74b7 Mon Sep 17 00:00:00 2001 From: azaozz Date: Mon, 21 Nov 2016 20:14:01 +0000 Subject: [PATCH] TinyMCE: avoid calling `editor.focus()` on loading the content in the editor. It may trigger scroll-into-view in the browser. Call the quirks fix in TinyMCE directly. Props gitlost. Fixes #38511. git-svn-id: https://develop.svn.wordpress.org/trunk@39334 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/tinymce/plugins/wpview/plugin.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js index 3202178612..e131474831 100644 --- a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js @@ -93,10 +93,10 @@ // Replace any new markers nodes with views. editor.on( 'setcontent', function( event ) { - if ( event.load && ! event.initial ) { - // Make sure that the editor is focussed. - // May refresh the content internally which resets the iframes. - editor.focus(); + if ( event.load && ! event.initial && editor.quirks.refreshContentEditable ) { + // Make sure there is a selection in Gecko browsers. + // Or it will refresh the content internally which resets the iframes. + editor.quirks.refreshContentEditable(); } wp.mce.views.render();