Skip to content

Commit

Permalink
Customizer: Show all widgets when the search field is cleared.
Browse files Browse the repository at this point in the history
When clicking the clear button on the widget search field, the search results should refresh to show all widgets.

Props Mahesh901122.
Fixes #47534.

Built from https://develop.svn.wordpress.org/trunk@45658


git-svn-id: http://core.svn.wordpress.org/trunk@45469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
pento committed Jul 18, 2019
1 parent 7149d65 commit 22412b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions wp-admin/js/customize-widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@
}
} );

// Clear the search results and trigger a `keyup` event to fire a new search.
// Clear the search results and trigger a new search.
this.$clearResults.on( 'click', function() {
self.$search.val( '' ).focus().trigger( 'keyup' );
self.$search.val( '' ).focus();
self.collection.doSearch( '' );
} );

// Close the panel if the URL in the preview changes
Expand Down
Loading

0 comments on commit 22412b1

Please sign in to comment.