mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-02 00:57:40 +02:00
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:
parent
5b15e8c11b
commit
f1c383454b
@ -5300,7 +5300,7 @@
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
$textarea.on( 'keydown', function onKeydown( event ) {
|
$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 ( escKeyCode === event.keyCode ) {
|
||||||
if ( ! $textarea.data( 'next-tab-blurs' ) ) {
|
if ( ! $textarea.data( 'next-tab-blurs' ) ) {
|
||||||
@ -5325,10 +5325,8 @@
|
|||||||
value = textarea.value;
|
value = textarea.value;
|
||||||
|
|
||||||
if ( selectionStart >= 0 ) {
|
if ( selectionStart >= 0 ) {
|
||||||
scroll = $textarea.scrollTop;
|
|
||||||
textarea.value = value.substring( 0, selectionStart ).concat( '\t', value.substring( selectionEnd ) );
|
textarea.value = value.substring( 0, selectionStart ).concat( '\t', value.substring( selectionEnd ) );
|
||||||
$textarea.selectionStart = textarea.selectionEnd = selectionStart + 1;
|
$textarea.selectionStart = textarea.selectionEnd = selectionStart + 1;
|
||||||
textarea.scrollTop = scroll;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
2
wp-admin/js/customize-controls.min.js
vendored
2
wp-admin/js/customize-controls.min.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user