Hi anyone can help me out from this issue, i am using drupal 8.2x better exposed filter and configured auto submit.when value change from my filter ajax results are not showing.
Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damodharan1991 created an issue. See original summary.

stewest’s picture

Version: 8.x-3.x-dev » 8.x-3.0-alpha2

+1 except I'm using the newest 8.x-3.0-alpha2 on Drupal 8.2.6

Phonoman’s picture

+1 also using the 8.x-3.0-alpha2 (2017-Jan-16) on Drupal 8.2.6 versions.

gcalex5’s picture

+1 also experiencing this

desammer’s picture

+1 the same for me

spheresh’s picture

It works fine for me.
Drupal - 8.2.6
Better Exposed Filters - 8.x-3.0-alpha2

Guys, would you give me more details?

gcalex5’s picture

spheresh;
Drupal 8.2.5, Better Exposed Filters 8.x-3.0-alpha2
I have a view(page) with an exposed filter(drop down), Ajax enabled, and the form exposed as a block.
In better exposed filters I have autosubmit + hide submit button.

Initially, I have the exposed block form on one page(front page), which when I select a dropdown option from it, it redirects to the views page just fine. However, when selecting another option from the exposed block form on that page the options do not update.

mikeker’s picture

There's not a lot to go on in the bug report, as @spheresh says in #6. Take a look at #2776615: Exposed filters break on blocks with AJAX filters, if your exposed filters are in a block and please test and report back on the patch in that issue.

See also: #2798951: Multi select filter w/ ajax.

Thanks!

mikeker’s picture

Status: Active » Postponed (maintainer needs more info)
dietr_ch’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
495 bytes

Hello

As @gcalex5 said in #7, the issue occurs only when the exposed form is shown in a block. The data-bef-auto-submit-full-form attribute is then not applied to the form element, but to a wrapping div (with class views-exposed-form). auto_submit.js only registers a change event function to form[data-bef-auto-submit-full-form], which works when the form is not in a block.

I attached a patch that also adds [data-bef-auto-submit-full-form] form to the set of matched forms.

Dietrich

dietr_ch’s picture

FileSize
1.27 KB

Hello again

Apparently, the autosubmit is not triggered on textfields. This is because jQuery.once should be used as e.g. $('div.calendar').once('name').each(function() { ... }), while the existing code passes the function as a second argument to once(). Maybe this was changed in the version of the plugin in D8 (currently 2.1.1)? Also, the core/jquery.once dependency is missing from the auto_submit library.

In attachment a new patch that solves these issues.

Dietrich

dietr_ch’s picture

dmsmidt’s picture

Title: Ajax filter not working » Auto submit filter not working properly
Version: 8.x-3.0-alpha2 » 8.x-3.x-dev
Priority: Major » Critical
FileSize
8.38 KB
8.64 KB

The auto submit is indeed problematic in a lot of cases.
Here is a rewrite/simplification, also using Drupal.debounce instead of custom logic.

Edit: ignore those patches! I left a ^ in my diff command.

dmsmidt’s picture

What would be nice: focus the field that triggered the autosubmit again after submit completes.
This helps when typing text or when using keys to navigate through select lists.
But that would be a separate issue and needs to be extensively tested for AJAX/non-AJAX views, and multiple views on a page.

dmsmidt’s picture

FileSize
3.8 KB
3.83 KB

And the patches again.

  • mikeker committed b8cd8f1 on 8.x-3.x
    Issue #2846222 by dmsmidt, dietr_ch, mikeker: Auto submit filter not...
mikeker’s picture

Priority: Critical » Major
Status: Needs review » Fixed
FileSize
1.55 KB

Committed with a few changes to comments and to add back in the selector that makes this work when an exposed form is used as a block.

Thank you everyone for your work and patience!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.