How to stop horizontal ionic scroll resetting position on tap


#1

I’m using ion-scroll with direction=“x” for a horizontal scrolling area.

Whenever I tap in the area, it immediately resets the X position to 0.

Has anyone had this issue before or knows how to resolve this issue?

Thanks.


#2

I have the same issue! Please some respond if there is a solution!

Thanks.


#3

Hi @panospcm. In my case I had a list of dates on a horizontal scroll and the content below got filtered depending on the date selected.

To resolve it on the items that could be tapped I had to add a class ‘button’ to them. At that point it worked but I needed go override ionics default button styling. Any position in between however reset the position. I just made sure there were no gaps in between.

This is the fix I did in the end. It may not be helpful for you on your project, but I hope it is.


#4

I just wanted to confirm that @Greendog’s button class fix above does appear to resolve the issue which I’ve also seen. Thanks for that. Just some css needed as mentioned.

To add to this, the reset doesn’t just happen to the tapped ion-scroll, it actually resets the position of all horizontal ion-scrolls which are visible.

I’ll try and get a minimal test can online somewhere soon so it can be debugged and shared.