Make WordPress Core

Changeset 58916


Ignore:
Timestamp:
08/20/2024 02:07:28 PM (7 weeks ago)
Author:
hellofromTonya
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.

Reviewed by hellofromTonya.
Merges [58914] to the 6.6 branch.

Follow-up to [58405].

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

Location:
branches/6.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.6

  • branches/6.6/src/js/_enqueues/wp/theme.js

    r58405 r58916  
    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.