akiran / akiran/react-slick

IOS 14 and up - slider won't scroll on drag

Open
#2,380 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
11.9k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

On mobile, IOS 14 and up (chrome and safari), the slider does not scroll when dragging it.

I have found that the following snippet seems to fix it.

**Fix**

`document.addEventListener("touchstart", () => {}, { passive: false });`

It works by overriding the touchStart event to not be passive, meaning that `e.preventDefault()` can run on this event, which seems to be a requirement for Slick Slider.

I'm not sure if I have missed a less hacky fix for this though. Has any one else solved this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.