Editor: prevent jumping when using the backspace button in the Text editor in Firefox and IE.
Fixes #37072. Built from https://develop.svn.wordpress.org/trunk@37684 git-svn-id: http://core.svn.wordpress.org/trunk@37650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
defe5e371b
commit
f78dd6fe2e
|
@ -86,17 +86,21 @@
|
|||
|
||||
var length = textEditor.value.length;
|
||||
var height = parseInt( textEditor.style.height, 10 );
|
||||
var top = window.scrollTop;
|
||||
|
||||
if ( length < oldTextLength ) {
|
||||
// textEditor.scrollHeight is not adjusted until the next line.
|
||||
textEditor.style.height = 'auto';
|
||||
|
||||
if ( textEditor.scrollHeight >= autoresizeMinHeight ) {
|
||||
if ( textEditor.scrollHeight > autoresizeMinHeight ) {
|
||||
textEditor.style.height = textEditor.scrollHeight + 'px';
|
||||
} else {
|
||||
textEditor.style.height = autoresizeMinHeight + 'px';
|
||||
}
|
||||
|
||||
// Prevent scroll-jumping in Firefox and IE.
|
||||
window.scrollTop = top;
|
||||
|
||||
if ( textEditor.scrollHeight < height ) {
|
||||
adjust();
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.6-alpha-37683';
|
||||
$wp_version = '4.6-alpha-37684';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue