angular-slider/angularjs-slider

Clicking slider handles or selection bar scrolls to window top

dexbytesmanish opened this issue · 11 comments

I am facing issue that when I click on slider handles or selection bar it scrolls to window top. can you pleas suggest way to avoid this situation ?

Could you please provide a demo? I have never
encountered such an issue with this library.

This is not an issue with this library. The problem comes from the fact you navigate to page/1/sort-by/default%20sorting/price/1-28200 when the slider is clicked and thus, the page scrolls to top.

If you don't want this, you should only navigate when the price value has really changed.

onEnd is called when the user finished on interaction with the slider. In this callback, you can write any custom logic to prevent unwanted actions.

You can compare the new values with the previous ones, if they haven't changed, don't do anything.

You need to store the previous values somehow. Anyway, if you want the price slider to reflect what's in the url, you need to know what's the current selection is. Thus, compare to this.

This is custom logic so I can't help more.