From 0b06e599401007cfc676928883c7d6c944deeb58 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Thu, 18 Jul 2019 05:54:10 +0000 Subject: [PATCH] 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 --- src/js/_enqueues/wp/customize/widgets.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/_enqueues/wp/customize/widgets.js b/src/js/_enqueues/wp/customize/widgets.js index 77f44def24..1506a31b8a 100644 --- a/src/js/_enqueues/wp/customize/widgets.js +++ b/src/js/_enqueues/wp/customize/widgets.js @@ -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