GeekyAnts / GeekyAnts/NativeBase

Dragging horizontal Slider doesn't prevent pan from going through to React Navigation modal (and swiping page vertically)

Open
#4,842 4 comments 3 reactions 0 assignees View on GitHub
bug triage v3
Dominant language
TypeScript
Stars
20.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

### Description

Dragging the `` doesn't capture the touch move and it bubbles up to the parent screen. When this is a modal, it starts moving because modals can be dragged down to close, and then it also cancels the slider thumb panning.

### CodeSandbox/Snack link

none

### Steps to reproduce

React Navigation setup:
```jsx
,
}}
>


```
NowPlayingScreen:
```tsx

{
console.log('Changing slider position', changingPosition)
setChangingPosition(changingPosition)
}}
onChangeEnd={position => {
console.log('Changed slider position', position)
if (currentAudioPostId) {
setCurrentPosition(position)
seek(position)
}
}}
onTouchStart={e => {
console.log('Slider touch started')
// e.stopPropagation()
// e.preventDefault()
// return true
}}
onTouchMove={e => {
console.log('Slider touch moved')
// e.stopPropagation()
// e.preventDefault()
// return true
}}
// onStartShouldSetResponder={() => true}
// onMoveShouldSetResponder={() => true}
onTouchCancel={() => {
console.log('Canceled changing slider position')
setChangingPosition(null)
}}
colorScheme='tertiary'
>



{
// console.log('move start slider thumb')
// return true
// }}
// onStartShouldSetResponder={() => {
// console.log('start slider thumb')
// return true
// }}
/>


```
All the commented parts were tested and failed to capture the pan responding.

### NativeBase Version

^3.3.7

### Platform

- [ ] Android
- [ ] CRA
- [x] Expo
- [X] iOS
- [ ] Next

### Other Platform

_No response_

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Slider and Slider.Thumb touch responder behavior in the React Native component and reproduce the interaction in the React Navigation modal described in the issue. Done means horizontal thumb dragging continues to update the slider without moving the modal or swiping the page vertically, while cancellation and end callbacks still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
frontend, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.