WordPress.org

Make WordPress Core

Changeset 37684


Ignore:
Timestamp:
06/11/2016 05:14:18 AM (3 years ago)
Author:
azaozz
Message:

Editor: prevent jumping when using the backspace button in the Text editor in Firefox and IE.

Fixes #37072.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/editor-expand.js

    r37659 r37684  
    8787            var length = textEditor.value.length;
    8888            var height = parseInt( textEditor.style.height, 10 );
     89            var top = window.scrollTop;
    8990
    9091            if ( length < oldTextLength ) {
     
    9293                textEditor.style.height = 'auto';
    9394
    94                 if ( textEditor.scrollHeight >= autoresizeMinHeight ) {
     95                if ( textEditor.scrollHeight > autoresizeMinHeight ) {
    9596                    textEditor.style.height = textEditor.scrollHeight + 'px';
    9697                } else {
    9798                    textEditor.style.height = autoresizeMinHeight + 'px';
    9899                }
     100
     101                // Prevent scroll-jumping in Firefox and IE.
     102                window.scrollTop = top;
    99103
    100104                if ( textEditor.scrollHeight < height ) {
Note: See TracChangeset for help on using the changeset viewer.