Skip to content
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

Scroll issue on mobile devices after "touch-action: none" styling #134

Closed
ins2718 opened this issue Feb 22, 2024 · 5 comments · Fixed by #143
Closed

Scroll issue on mobile devices after "touch-action: none" styling #134

ins2718 opened this issue Feb 22, 2024 · 5 comments · Fixed by #143
Labels
bug Something isn't working has workaround Issue has a viable workaround

Comments

@ins2718
Copy link

ins2718 commented Feb 22, 2024

Hello everyone, I wanted to bring to your attention an issue that arose in one of the commits early in 2023 (Commit Link).

In this commit, the widget received the style property "touch-action: none", resulting in the disruption of scrolling on relevant devices. This has become a critical issue, especially on mobile phones, where the widget might occupy a significant portion of the screen.

@LefanTan
Copy link

You can get around this by adding style={{ touchAction: "pan-y" }} to the component

@nerdyman
Copy link
Owner

Thanks @ins2718 & @LefanTan,

I did add touch-action: none for a reason though I can't remember why now, might have been a Firefox issue. I'll take a look at a fix.

@nerdyman nerdyman added bug Something isn't working has workaround Issue has a viable workaround labels Feb 23, 2024
@ins2718
Copy link
Author

ins2718 commented Feb 24, 2024

You can get around this by adding style={{ touchAction: "pan-y" }} to the component

Yes, I fixed it by adding the class !touch-pen-y (tailwind). However, this issue was discovered accidentally and is not present on the demo pages. Therefore, I assume it's more likely a bug and should be reported.

@nerdyman
Copy link
Owner

touch-action: none was added to avoid the slider 'disconnecting' when you drag back and forth on touch devices. E.g. if you drag back and forth on Safari iOS without the style applied the slider will stop sliding if your finger or thumb isn't completely on the screen. I'll see if there's a better way to keep it sliding while dragging without stopping general scrolling - the style might just need to be applied while the slider is in the dragging state.

@nerdyman
Copy link
Owner

pan-y is now the default in v4. I need to do testing on other devices before doing a final release but there is a pre-release ready to go.

It can be installed by running:

pnpm i react-compare-slider@beta
# Or
yarn add react-compare-slider@beta
# Or
npm i react-compare-slider@beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has workaround Issue has a viable workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants