Make WordPress Core

Changeset 39569


Ignore:
Timestamp:
12/12/2016 01:55:02 AM (8 years ago)
Author:
dd32
Message:

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

Props tyxla, sstoqnov for testing, celloexpressions for testing.
See #38667.
Merges [39557] to the 4.7 branch.
Fixes #39134.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-admin/js/customize-controls.js

    r39505 r39569  
    53015301
    53025302                $textarea.on( 'keydown', function onKeydown( event ) {
    5303                     var selectionStart, selectionEnd, value, scroll, tabKeyCode = 9, escKeyCode = 27;
     5303                    var selectionStart, selectionEnd, value, tabKeyCode = 9, escKeyCode = 27;
    53045304
    53055305                    if ( escKeyCode === event.keyCode ) {
     
    53265326
    53275327                    if ( selectionStart >= 0 ) {
    5328                         scroll = $textarea.scrollTop;
    53295328                        textarea.value = value.substring( 0, selectionStart ).concat( '\t', value.substring( selectionEnd ) );
    53305329                        $textarea.selectionStart = textarea.selectionEnd = selectionStart + 1;
    5331                         textarea.scrollTop = scroll;
    53325330                    }
    53335331
Note: See TracChangeset for help on using the changeset viewer.