Bug: when using multiple `DragGesture`s in a ZStack only the last one works

Open
#547 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
swift
Domain
mobile

Research direction

Start with the minimal reproduction in the linked DimitarNestorov/skip-sliders-test repository and reproduce the horizontal range slider on Android. Inspect how its two DragGestures are attached in the ZStack, then verify that both gestures respond to touches rather than only the second one. Done means the reproduction behaves as expected on Android without breaking the slider interaction.

Written by the indexing model from the issue text.

Description

https://github.com/user-attachments/assets/ed1005c3-ea1f-45be-a43c-2828a265319f

I'm trying to bring the horizontal range slider from https://github.com/spacenation/swiftui-sliders to a Skip app. I was not able to use the library directly due to many compilation issues so I decided to trim it down to just what I need (the horizontal range slider only).

As I was doing that I got to a pretty simple slider but it seems like on Android only the second DragGesture reacts to touches.

Minimal Reproduction

https://github.com/DimitarNestorov/skip-sliders-test

Dominant language
Swift
Stars
334
Forks
95
Avg merge
2d 10h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from skiptools/skip-ui

All issues in skiptools/skip-ui

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.