When using 'Exposed form in block' with Ajax enabled the 'Reset' button is never shown, so it's not possible to reset the filter selections.
When using 'Exposed form in block' with Ajax enabled the 'Reset' button is never shown, so it's not possible to reset the filter selections.
Comments
Comment #2
lendudeDidn't try to reproduce but #2732111: Reset button doesn't work and never gets removed on AJAX enabled views should give a nice indication where we could add some tests for this.
Comment #3
lestat commentedChecking this issue DrupalCon Dublin.
Comment #4
Leagnus commentedConfirm the issue on Drupal 8.5.x-dev and PHP v.7.0.11.
Workaround is
Comment #5
ippy commentedYep, I can confirm that Leagnus's simple workaround will do the trick (D8.6 + PHP 7).
Needs targeting to your own form and submit ids obviously.
Comment #6
andreynacarrasco commentedSorry for my ignorance (and my english...) but, where do I implement @Leagnus´s workaround?
Comment #7
socialnicheguru commentedThere is no reset button if a view is using ajax either.
How can this fix be implemented? Is it in a custom module?
Comment #8
ippy commentedBetter late than never I suppose...
I think I achieved this by way of the following (or some combination thereof - sorry, its a while ago now. Probably this: https://www.drupal.org/docs/8/theming/adding-stylesheets-css-and-javascr... as we only use it on this one page):
Can be seen functioning here: https://bridge47.org/resources - search for anything that yields results in order to get the reset button dynamically attached via the extra js that is called for this page.
Basically add the js in a file, make it available to the theme and then call it on whatever page/s you need it.
Comment #11
colanCopied title from #3063267: Support "Use AJAX" behaviour on "Reset" button in views, which I've marked as a duplicate. As mentioned over there, and in #7, this isn't specific to exposed blocks.
Here's the only useful comment from over there:
Comment #15
smustgrave commentedGoing to close as can't reproduce
I tested by enabling ajax on the admin/content view
Filtered by a string
Verified reset button appears and is functional
If this is still an issue please reopen and provide an updated IS.
Comment #16
siramsay commented@smustgrave
I can reproduce this. You need to use the Exposed form setting Exposed form in block and set it to Yes.
Then place the exposed from using block placement or in code.
Comment #17
jayhuskinsMarking this as a duplicate of issue #3246142