Reset button, now using ajax, does not reset exposed form values when form is in a block.

Created on 23 May 2024, 7 months ago
Updated 17 September 2024, 3 months ago

Steps to reproduce

  1. Create a view with filter criteria, expose at least one filter to visitors
  2. Set "Exposed form in block" to "yes"
  3. Add view block and exposed form block to node
  4. Change at least one filter in the view
  5. Click "reset"

It should be noted that the data in the view block itself DOES reset, but the exposed form does not.

๐Ÿ› Bug report
Status

Active

Version

7.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States joakland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @joakland
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States ezra

    Seconding this. I'll add that I thought turning ajax off would be a solution, but it not fix the issue.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States cajewell Madison, WI

    I also ran into this issue. I have the same situation, with all five steps identical to the steps joakland listed above. The data in the view block does reset, but the check boxes or default fields on the exposed form remain checked after clicking reset. I tested this in versions 6.0.6 and 7.0.0-beta1, and both had this result. For troubleshooting, I set up a dev site and reverted back to BEF versions 6.0.3, 6.0.4, and 6.0.5. All of these versions worked as expected, with the results reset and the checkboxes cleared. So the issue started at version 6.0.6.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Can confirm this issue but don't have a fix.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain idiaz.roncero Madrid

    Please see this comment ๐Ÿ› Reset button does not use AJAX Needs work for a quick workaround that just re-enables the Drupal core behavior - to avoid AJAX on Clear Filter buttons.

    With facets 3.x we are facing the exact opposite as cajewell said: exposed form in a block is reset when using clear filters; but view content area results are not - they keep the old filters applied.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Goal of contrib is to be able to do things core cannot. Agree this is a bug but canโ€™t just rip it out.

    Temporary solution that would be accepted is to add a setting to disable this feature.

    Will need an update hook that defaults to true so existing sites arenโ€™t broken.

    May also be a bug with the views module itself but havenโ€™t dug through the issue queue.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States AaronBauman Philadelphia

    The suggestion in #6 does not fix the issue for me.

    Reset button still causes a redirect to the attached page display's URL, rather than reloading the current URL.

    Not sure if straight duplicate, but seems like this is a core issue also.
    ๐Ÿ› Viewsform has incorrect form submit url if loaded through ajax Needs work

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DamienMcKenna NH, USA

    fwiw the "reset all" link doesn't even show for me, which might be a separate bug.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States anilu@ Houston, TX

    Having the same issue on a different use case, I have view with exposed filters but "Exposed form in block" is disabled. I am using the page view with ajax and also have a view template with a subtitle that should change when filter selections change.
    The view filters are working but when I click on reset the exposed values change but the subtitle in the twig template is not refreshing.

Production build 0.71.5 2024