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.
Built from https://develop.svn.wordpress.org/branches/6.6@58916


git-svn-id: http://core.svn.wordpress.org/branches/6.6@58312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2024-08-20 14:09:17 +00:00
parent 3ab9d9a827
commit 2463b10f68
3 changed files with 9 additions and 7 deletions

View File

@ -96,7 +96,7 @@ themes.view.Appearance = wp.Backbone.View.extend({
}, },
// Defines search element container. // Defines search element container.
searchContainer: $( '.search-form .search-box' ), searchContainer: $( '.search-form' ),
// Search input and view // Search input and view
// for current theme collection. // for current theme collection.
@ -118,11 +118,13 @@ themes.view.Appearance = wp.Backbone.View.extend({
// Render and append after screen title. // Render and append after screen title.
view.render(); view.render();
this.searchContainer this.searchContainer
.find( '.search-box' )
.append( $.parseHTML( '<label for="wp-filter-search-input">' + l10n.search + '</label>' ) ) .append( $.parseHTML( '<label for="wp-filter-search-input">' + l10n.search + '</label>' ) )
.append( view.el ) .append( view.el );
.on( 'submit', function( event ) {
event.preventDefault(); this.searchContainer.on( 'submit', function( event ) {
}); event.preventDefault();
});
}, },
// Checks when the user gets close to the bottom // Checks when the user gets close to the bottom

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.6.2-alpha-58891'; $wp_version = '6.6.2-alpha-58916';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.