New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing filters shouldn't force the user to the top #10993
Comments
Yes I know that it's added but it's not good practice. The only time it would actually be useful is if the user is at the bottom of the page. It shouldn't force a scroll to the top when changing sort orter, changing filters and more. It's a very disruptive pattern. Every time the user makes a choise he/she is forced to scroll no matter what. At the very least we as theme makers (and possible even shop owners) should have the possibility to change that behaviour. But since it's inbedded in the core we can't do anything except trying to hinder it with even more scripts which obviously isn't ideal at all. |
@marionf what do you think about this issue? |
@khouloudbelguith @marionf Any update on this? I would like to know what you are planning to do here because if this behaviour is here to stay I will have to make some sort of override for future builds since it's not optimal at all in it's current state. |
Hi @dennispw, Sorry not yet. |
Do you have any workaround for this to use while prestashop team have other priorities? |
I found a temporary solution. It is necessary to comment out this line in themes/core.js: |
Hi @karopka, Would you be willing to make a pull request on GitHub with your code suggestion? |
@karopka That's basically it. Not optimal by a long shot but it's basically it unfortunately. Looking at the code it seems to be specifically added when using the pagination and since it's added to the core I have a hard time seeing it will be changed any time soon, even if a pull request is made. Git blame: 9245f05 As I've said prior to this, if this is indeed the intended behaviour there should at the very least be some sort of check if the user has used the paginaton and only then scroll the user to the top. Or better, scroll them to the top of the products. Of course even better than that, don't do anything at all and leave that decision up to the owners of each shop and/or theme developers. |
@khouloudbelguith I've attached a video to better explain the issue. Every single click tied to the filter, pagination and/or sort order causes a jump to the top. Demo: Screen record (.zip) It's an extremely disruptive pattern. As of right now, there is no proper way to disable this behaviour. The only two options we really have are:
|
@dennispw, Thank you for reporting this issue and how you want to fix it. |
Yesterday I tried to do it but the file core.js in the dev branch is compressed. It's ok to create pull request with uncompressed file? |
@karopka, you can create a PR & our Dev will help you getting it right. |
@khouloudbelguith I've added a PR. |
Hello @dennispw There will always be cases where it will be necessary to scroll up or down according to the number of products displayed on the page, the number of filters configured in faceted search, the device used ... So, we talked about this with @TristanLDD & @colinegin and we don't want to change the current behavior |
Is your feature request related to a problem? Please describe.
When using the pagination or changing filters (using the ps_facetedsearch module as an example), the user is scrolled to the top of the document. This is considered bad practice since you are taking the control out of the users hands. It could be useful when using the pagination as long as the pagination is located at the bottom of the page but other than that I would really reconsider this functionality.
As an example, you often have to scroll down a bit to see the products and any sorting options or filters. Let's say you wanted to selec the "Size: XL" filter. You scroll down, find it and unfortunately you hit the "Size: L" by mistake. Now you're back at the top of the page and have to scroll down yet again.
Another example, let's say you want to filter on "Color: Blue" and "Color: Red". You have to scrolldown twice for each selection.
It get's even worse if you're on a mobile device where the total length of the content is usually longer.
Every single input made by the user will most likely result in having to scroll down - don't take the control out of the users hands unless absolutely necessary. This is something each individual shop owner and/or theme should be in control of and not the core platform.
Describe the solution you'd like
Simply don't force a scroll to the top.
Additional context
I initially reported this in the forge but nothing happened: BOOM-4608
The text was updated successfully, but these errors were encountered: