How to reproduce:
1. The "Dropdown" widget is selected for the facet.
2. Place this facet on the view page (the view should not use Ajax).
3. Select any option from the drop-down list.
4. Try resetting the facet value by selecting the default option.

Result:
Click on default option doesn't reload page. Error in console:

Uncaught TypeError: Cannot read property 'click' of undefined
    at HTMLSelectElement.<anonymous> (dropdown-widget.js?v=8.5.4:74)
    at HTMLSelectElement.dispatch (jquery.min.js?v=3.2.1:3)
    at HTMLSelectElement.q.handle (jquery.min.js?v=3.2.1:3)
CommentFileSizeAuthor
#4 dropdown-default-2984151-4.patch1.39 KBnileshlohar

Comments

qzmenko created an issue. See original summary.

anjalikhandelwal’s picture

Please attach some screenshots for better understanding

qzmenko’s picture

Seems like #2826449: Ajax Facets blocks for views broken the functionality of the drop-down widget that does not use ajax:

       // Go to the selected option when it's clicked.
       $dropdown.on('change.facets', function () {
-        window.location.href = $(this).val();
+        var a = $($ul).find("[data-drupal-facet-item-id='" + $(this).find(':selected').data('drupalFacetItemId') + "']");
+        $(a)[0].click();
       });

When you click on the default option, var a is empty in the drop-down list. Because of this, clicking on the default option does not work and the js error in the console appears.

nileshlohar’s picture

Status: Active » Needs review
StatusFileSize
new1.39 KB

Got the same issue.
I fixed it by a attached patch.

strykaizer’s picture

Priority: Normal » Major

Experienced the same issue
#4 seems to fix it.

Gonna push priority here

borisson_’s picture

Committed and pushed.

borisson_’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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