WordPress.org

Make WordPress Core

Changeset 45227


Ignore:
Timestamp:
04/17/2019 07:17:26 AM (17 months ago)
Author:
afercia
Message:

Accessibility: Make the Tags meta box better support Input Method Editor (IME) converters.

Also, restores the keyboard interaction behavior prior to [41988] by requesting one single Enter key press to add a tag.

Props ryanshoover, miyauchi.
Fixes #45371.

Location:
trunk/src/js/_enqueues/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/tags-box.js

    r43577 r45227  
    370370             * Handles pressing enter on the new tag input field.
    371371             *
    372              * Prevents submitting the post edit form.
     372             * Prevents submitting the post edit form. Uses `keypress` to take
     373             * into account Input Method Editor (IME) converters.
    373374             *
    374375             * @since 2.9.0
     
    382383                    tagBox.userAction = 'add';
    383384                    tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
    384                     event.preventDefault();
    385                     event.stopPropagation();
    386                 }
    387             }).keypress( function( event ) {
    388                 if ( 13 == event.which ) {
    389385                    event.preventDefault();
    390386                    event.stopPropagation();
  • trunk/src/js/_enqueues/admin/tags-suggest.js

    r44538 r45227  
    108108                    event.preventDefault();
    109109                } else if ( $.ui.keyCode.ENTER === event.keyCode ) {
     110                    // If we're in the edit post Tags meta box, add the tag.
     111                    if ( window.tagBox ) {
     112                        window.tagBox.userAction = 'add';
     113                        window.tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
     114                    }
     115
    110116                    // Do not close Quick Edit / Bulk Edit
    111117                    event.preventDefault();
Note: See TracChangeset for help on using the changeset viewer.