Skip Navigation

[Resolved] View: Clear filters on "Select multiple" field error

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 16 replies, has 2 voices.

Last updated by Waqar 1 year ago.

Assisted by: Waqar.

Author
Posts
#2664565

Hi Waqar, Here is a screen recording of what is happening - hidden link

When you are on the 2nd page and select a filter is scrolls right down to the very bottom of the page where the footer is. You then have to scroll back up the page to see the search results. I don't thing this is an issue of waiting for the results to load as this does not happen on the 1st page of the results.

It does the same thing when you are on the 2nd page and there are no filters selected, then you click "Clear filters" it scrolls down to the footer. (I know this one is not necessary to fix as the user doesn't need to clear filters when there are none selected) but just to show you the same "Scroll down" thing happens.

#2664923

Thank you for sharing the screen recording and I see what you mean.

The view currently has these two custom script snippets:


jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated js_event_wpv_pagination_completed', function( event, data ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.layout (object) The jQuery object for the View layout wrapper
    */
    jQuery(".wpv-filter-form select").chosen()
});

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
    jQuery('html, body').animate({ scrollTop: 0 }, 'fast');
 
});

You can replace these with a combined single script snippet, like this:


jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated js_event_wpv_pagination_completed', function( event, data ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.layout (object) The jQuery object for the View layout wrapper
    */
    jQuery(".wpv-filter-form select").chosen();
    jQuery('html, body').animate({ scrollTop: 0 }, 'fast');
});

This should initiate scroll and select field styles, on both events ( search results update and the pagination results update ).

#2665131

Working perfectly now! Thank you for your help.