Make WordPress Core

Changeset 58914


Ignore:
Timestamp:
08/19/2024 07:17:42 PM (8 weeks ago)
Author:
joedolson
Message:

Themes: Fix themes search event not firing on enter.

Attach the submit event to the parent search form in the installed and add new theme screen. Following [58405], the submit event was no longer attached to an object that was able to handle form submissions.

Props nithi22, nithins53, josklever, the-ank, debarghyabanerjee, sabernhardt, jeherve, hellofromtonya.
Fixes #61578.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/theme.js

    r58405 r58914  
    9797
    9898    // Defines search element container.
    99     searchContainer: $( '.search-form .search-box' ),
     99    searchContainer: $( '.search-form' ),
    100100
    101101    // Search input and view
     
    119119        view.render();
    120120        this.searchContainer
     121            .find( '.search-box' )
    121122            .append( $.parseHTML( '<label for="wp-filter-search-input">' + l10n.search + '</label>' ) )
    122             .append( view.el )
    123             .on( 'submit', function( event ) {
    124                 event.preventDefault();
    125             });
     123            .append( view.el );
     124
     125        this.searchContainer.on( 'submit', function( event ) {
     126            event.preventDefault();
     127        });
    126128    },
    127129
Note: See TracChangeset for help on using the changeset viewer.