Skip to content

Commit 913ef22

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@58914 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 04694fb commit 913ef22

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/js/_enqueues/wp/theme.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ themes.view.Appearance = wp.Backbone.View.extend({
9696
},
9797

9898
// Defines search element container.
99-
searchContainer: $( '.search-form .search-box' ),
99+
searchContainer: $( '.search-form' ),
100100

101101
// Search input and view
102102
// for current theme collection.
@@ -118,11 +118,13 @@ themes.view.Appearance = wp.Backbone.View.extend({
118118
// Render and append after screen title.
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

128130
// Checks when the user gets close to the bottom

0 commit comments

Comments
 (0)