- Issue created by @mkindred
- Status changed to Needs review
9 months ago 10:17am 13 February 2024 - 🇮🇪Ireland markconroy
I'm not sure exactly why we need to disable the checkboxes when we are creating checkboxes from links for facets, so I created this small patch to remove the disabling of the checkboxes and it seems to fix the back button issue.
- 🇺🇸United States mkindred
@markconroy I like disabling them after selecting one to give the user feedback and prevent clicking on a second facet prior to loading the new page. I've shopped on quite a few ecommerce sites where the subsequent page was slow to load, and without feedback I thought I might have missed the facet link.
- 🇮🇪Ireland markconroy
and prevent clicking on a second facet prior to loading the new page.
^ That's a good point.
- 🇫🇷France AimadBachar
Hello,
The patch stop-disabling-checkboxes-3416333-4.patch works, I can now use the facets after using the back button on my web browser.
Thanks - 🇨🇦Canada jmoruzi Brantford, ON
The following applies to both 2.0.8 (patched or un-patched) and 3.0.0-beta1
Neither of these patches has any affect for me. I tested each patch individually on v2.0.8, as well as together, and in all 3 situations I see the same behaviour as if no patches are installed. In all browsers facets work as expected as long as you do not touch the back button.
There is no change in behaviour in Firefox, and there are issues in Chromium browsers as well.
In Firefox:
- I select a facet and results are filtered properly.
- Select a second facet and results are filtered properly.
- Click the back button, and the previous page loads with the results from the first facet, which is the desired behaviour, but both facets are still selected, and disabled
- Click the back button again, and only the first facet is selected, but disabled
Even if I click the back button again to go to the previous page that has filtered results, and then select the forward button to go to the page with the faceted results, the facets are still disabled until I reload the page.
Chrome, Edge and Brave:
There are no issues with the facets being disabled, but they are not activated properly once you use the back button.
- Select a facet and results are filtered
- Select a second facet, and results are filtered
- Uncheck the first facet and results are filtered properly
- Click the back button, you're taken back to the previous page, but the facet that was deselected in step 3 is still unchecked, so there is a disconnect between the selected facets and the results shown on the page. You're seeing the result of facet 1 and 2 being selected, but only facet 2 is checked.
- Uncheck facet 2, the page reloads, and now the first facet is checked. The results on the page are filtered properly.
- Click the back button. No facets are checked, but the results are filtered on the first and second facets.
This may be the same behaviour you would see in Firefox, but since the facets are disabled after clicking the back button there's no way to know.
- 🇳🇱Netherlands Drumanuel
I'm having the same problem (also in Chrome).
Instead of removing the disableFacet function, I went for a change to the unload function.
What I found is that onunload is triggered in Firefox (and Chrome) after pressing the browser's back button, while onbeforeunload is not.
I could have used the solution discussed here, using both onunload and onbeforeunload, but I'm not sure why this would be better than the solution in the attached patch.
https://stackoverflow.com/questions/6895564/difference-between-onbeforeu...