Skip to content

Commit b20b346

Browse files
committed
Prevent scrolling when touch on thumb
1 parent d5cc8bf commit b20b346

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/craft/stations/SkeuomorphismRollingSlider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ function Slider({ value, onChange }: SliderProps) {
3030

3131
const handlePointerDown = (event: PointerEvent) => {
3232
event.preventDefault();
33+
event.stopPropagation();
3334
setIsDragging(true);
3435
updateProgress(event.clientX);
3536

3637
const handlePointerMove = (event: PointerEvent) => {
3738
event.preventDefault();
39+
event.stopPropagation();
3840
updateProgress(event.clientX);
3941
setIsDragging(true);
4042
};
@@ -71,7 +73,7 @@ function Slider({ value, onChange }: SliderProps) {
7173
/>
7274
{/* Slider thumb */}
7375
<motion.div
74-
className='absolute top-1/2 size-14 cursor-grab overflow-hidden rounded-full shadow-[0_0_10px_rgba(0,0,0,0.5)]'
76+
className='absolute top-1/2 size-14 cursor-grab touch-none overflow-hidden rounded-full shadow-[0_0_10px_rgba(0,0,0,0.5)]'
7577
style={{
7678
x: thumbXValue,
7779
translateX: '-50%',

0 commit comments

Comments
 (0)