Merge pull request #16087 from woocommerce/fix/race
Remove race condition
This commit is contained in:
commit
0b3b0058f5
|
@ -273,15 +273,15 @@ class WC_Widget_Layered_Nav extends WC_Widget {
|
|||
echo '</form>';
|
||||
|
||||
wc_enqueue_js( "
|
||||
// Submit form on change if standard dropdown.
|
||||
jQuery( '.dropdown_layered_nav_" . esc_js( $taxonomy_filter_name ) . ":not([multiple])' ).change( function() {
|
||||
jQuery( this ).closest( 'form' ).submit();
|
||||
});
|
||||
|
||||
// Update value on change.
|
||||
jQuery( '.dropdown_layered_nav_" . esc_js( $taxonomy_filter_name ) . "' ).change( function() {
|
||||
var slug = jQuery( this ).val();
|
||||
jQuery( ':input[name=\"filter_" . esc_js( $taxonomy_filter_name ) . "\"]' ).val( slug );
|
||||
|
||||
// Submit form on change if standard dropdown.
|
||||
if ( ! jQuery( this ).attr( 'multiple' ) ) {
|
||||
jQuery( this ).closest( 'form' ).submit();
|
||||
}
|
||||
});
|
||||
|
||||
// Use Select2 enhancement if possible
|
||||
|
|
Loading…
Reference in New Issue