Ticket #48198: 48198.5.diff
File 48198.5.diff, 2.2 KB (added by , 5 years ago) |
---|
-
src/js/_enqueues/wp/customize/nav-menus.js
216 216 } 217 217 } ); 218 218 219 // Clear the search results and trigger a `keyup` event to fire a new search.219 // Clear the search results and trigger an `input` event to fire a new search. 220 220 this.$clearResults.on( 'click', function() { 221 self.$search.val( '' ).focus().trigger( ' keyup' );221 self.$search.val( '' ).focus().trigger( 'input' ); 222 222 } ); 223 223 224 224 this.$el.on( 'input', '#custom-menu-item-name.invalid, #custom-menu-item-url.invalid', function() { … … 733 733 $( 'body' ).removeClass( 'adding-menu-items' ); 734 734 $( '#available-menu-items .menu-item-handle.item-added' ).removeClass( 'item-added' ); 735 735 736 this.$search.val( '' ).trigger( ' keyup' );736 this.$search.val( '' ).trigger( 'input' ); 737 737 }, 738 738 739 739 // Add a few keyboard enhancements to the panel. … … 1819 1819 /* 1820 1820 * If the menu item deleted is the only of its instance left, 1821 1821 * remove the check icon of this menu item in the right panel. 1822 */ 1822 */ 1823 1823 _.each( addedItems, function( addedItem ) { 1824 1824 var menuItemId, menuItemControl, matches; 1825 1825 1826 1826 // This is because menu item that's deleted is just hidden. 1827 1827 if ( ! $( addedItem ).is( ':visible' ) ) { 1828 1828 return; -
src/js/_enqueues/wp/customize/widgets.js
193 193 } 194 194 } ); 195 195 196 // Clear the search results and trigger a new search.196 // Clear the search results and trigger an `input` event to fire a new search. 197 197 this.$clearResults.on( 'click', function() { 198 self.$search.val( '' ).focus(); 199 self.collection.doSearch( '' ); 198 self.$search.val( '' ).focus().trigger( 'input' ); 200 199 } ); 201 200 202 201 // Close the panel if the URL in the preview changes. … … 385 384 386 385 $( 'body' ).removeClass( 'adding-widget' ); 387 386 388 this.$search.val( '' ) ;387 this.$search.val( '' ).trigger( 'input' ); 389 388 }, 390 389 391 390 /**