Customizer: Show all widgets when the search field is cleared.

When clicking the clear button on the widget search field, the search results should refresh to show all widgets.

Props Mahesh901122.
Fixes #47534.


git-svn-id: https://develop.svn.wordpress.org/trunk@45658 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2019-07-18 05:54:10 +00:00
parent e6e96d0ef9
commit 0b06e59940

View File

@ -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