Make WordPress Core

Changeset 39334


Ignore:
Timestamp:
11/21/2016 08:14:01 PM (8 years ago)
Author:
azaozz
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js

    r39299 r39334  
    9494        // Replace any new markers nodes with views.
    9595        editor.on( 'setcontent', function( event ) {
    96             if ( event.load && ! event.initial ) {
    97                 // Make sure that the editor is focussed.
    98                 // May refresh the content internally which resets the iframes.
    99                 editor.focus();
     96            if ( event.load && ! event.initial && editor.quirks.refreshContentEditable ) {
     97                // Make sure there is a selection in Gecko browsers.
     98                // Or it will refresh the content internally which resets the iframes.
     99                editor.quirks.refreshContentEditable();
    100100            }
    101101
Note: See TracChangeset for help on using the changeset viewer.