Make WordPress Core

Ticket #45371: 45371.patch

File 45371.patch, 1.2 KB (added by miyauchi, 7 years ago)
  • src/js/_enqueues/admin/tags-box.js

    diff --git src/js/_enqueues/admin/tags-box.js src/js/_enqueues/admin/tags-box.js
    index d47cbed8a5..5d796051aa 100644
     
    377377                         *
    378378                         * @return {void}
    379379                         */
    380                         $( 'input.newtag', ajaxtag ).keypress( function( event ) {
    381                                 if ( 13 == event.which ) {
     380                        $( 'input.newtag', ajaxtag ).on( 'compositionend', function( event ) {
     381                                this.compositionend = true;
     382                        } ).keyup( function( event ) {
     383                                if ( true == this.compositionend ) {
     384                                        this.compositionend = false;
     385                                        return;
     386                                }
     387                                if ( 13 == event.which && true != this.compositionend ) {
    382388                                        tagBox.userAction = 'add';
    383389                                        tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
    384390                                        event.preventDefault();
    385391                                        event.stopPropagation();
    386392                                }
    387                         }).keypress( function( event ) {
     393                        } ).keypress( function( event ) {
    388394                                if ( 13 == event.which ) {
    389395                                        event.preventDefault();
    390396                                        event.stopPropagation();
    391397                                }
    392                         }).each( function( i, element ) {
     398                        } ).each( function( i, element ) {
    393399                                $( element ).wpTagsSuggest();
    394                         });
     400                        } );
    395401
    396402                        /**
    397403                         * Before a post is saved the value currently in the new tag input field will be