Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

fix(gestures): Fix gesture navigation for chrome #191

Merged
merged 6 commits into from
Sep 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ const Slider: React.FunctionComponent<SliderProps> = ({

// see: https://github.com/react-spring/react-spring/issues/861
// @ts-ignore
springPropsRef.update((index) => ({
offset: (active && down ? xDelta : 0) / width + (index - slide),
})).start();
springPropsRef
.update((index) => ({
offset: (active && down ? xDelta : 0) / width + (index - slide),
}))
.start();
}
},
onClick: () => {
Expand Down Expand Up @@ -270,6 +272,7 @@ const Slider: React.FunctionComponent<SliderProps> = ({
width: `${100 / slidesAtOnce}%`,
height: "100%",
willChange: "transform",
touchAction: "none",
}}
>
{childs[index]}
Expand Down