Make WordPress Core

Ticket #48198: 48198.diff

File 48198.diff, 977 bytes (added by garrett-eclipse, 4 years ago)

Update the clear-results action to reset the search panel.

  • src/js/_enqueues/wp/customize/nav-menus.js

     
    190190                 */
    191191                initialize: function() {
    192192                        var self = this;
     193                                $searchSection = $( '#available-menu-items-search' ),
     194                                $otherSections = $( '#available-menu-items .accordion-section' ).not( $searchSection );
    193195
    194196                        if ( ! api.panel.has( 'nav_menus' ) ) {
    195197                                return;
     
    219221                        // Clear the search results and trigger a `keyup` event to fire a new search.
    220222                        this.$clearResults.on( 'click', function() {
    221223                                self.$search.val( '' ).focus().trigger( 'keyup' );
     224                                $searchSection.removeClass( 'open' );
     225                                $otherSections.show();
     226                                self.$clearResults.removeClass( 'is-visible' );
    222227                        } );
    223228
    224229                        this.$el.on( 'input', '#custom-menu-item-name.invalid, #custom-menu-item-url.invalid', function() {