diff options
author | Joe Dolson <joedolson@git.wordpress.org> | 2024-08-19 19:17:42 +0000 |
---|---|---|
committer | Joe Dolson <joedolson@git.wordpress.org> | 2024-08-19 19:17:42 +0000 |
commit | 913ef22dd0f07fc4a2cf2a373096ae1a1cd5d2ce (patch) | |
tree | 5a2a349728b5d23d39c405c6de793fcf5e7f1491 /src | |
parent | 04694fbf545bacadc7ff733b1465524f9934864e (diff) | |
download | wordpress-913ef22dd0f07fc4a2cf2a373096ae1a1cd5d2ce.tar.gz wordpress-913ef22dd0f07fc4a2cf2a373096ae1a1cd5d2ce.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/js/_enqueues/wp/theme.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 65b5b4cf1c..7e1d2550cd 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -96,7 +96,7 @@ themes.view.Appearance = wp.Backbone.View.extend({ }, // Defines search element container. - searchContainer: $( '.search-form .search-box' ), + searchContainer: $( '.search-form' ), // Search input and view // for current theme collection. @@ -118,11 +118,13 @@ themes.view.Appearance = wp.Backbone.View.extend({ // Render and append after screen title. view.render(); this.searchContainer + .find( '.search-box' ) .append( $.parseHTML( '<label for="wp-filter-search-input">' + l10n.search + '</label>' ) ) - .append( view.el ) - .on( 'submit', function( event ) { - event.preventDefault(); - }); + .append( view.el ); + + this.searchContainer.on( 'submit', function( event ) { + event.preventDefault(); + }); }, // Checks when the user gets close to the bottom |