Customize: Prevent scrolling custom_css textarea to top when pressing tab.

Props tyxla, sstoqnov for testing, celloexpressions for testing.
See #38667.
Fixes #39134.

Built from https://develop.svn.wordpress.org/trunk@39557


git-svn-id: http://core.svn.wordpress.org/trunk@39497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2016-12-10 00:44:40 +00:00
parent 5b15e8c11b
commit f1c383454b
3 changed files with 3 additions and 5 deletions

View File

@ -5300,7 +5300,7 @@
} );
$textarea.on( 'keydown', function onKeydown( event ) {
var selectionStart, selectionEnd, value, scroll, tabKeyCode = 9, escKeyCode = 27;
var selectionStart, selectionEnd, value, tabKeyCode = 9, escKeyCode = 27;
if ( escKeyCode === event.keyCode ) {
if ( ! $textarea.data( 'next-tab-blurs' ) ) {
@ -5325,10 +5325,8 @@
value = textarea.value;
if ( selectionStart >= 0 ) {
scroll = $textarea.scrollTop;
textarea.value = value.substring( 0, selectionStart ).concat( '\t', value.substring( selectionEnd ) );
$textarea.selectionStart = textarea.selectionEnd = selectionStart + 1;
textarea.scrollTop = scroll;
}
event.stopPropagation();

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-39556';
$wp_version = '4.8-alpha-39557';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.