[Web] A pan that starts on a Pressable presses it when the mouse button is released
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 57/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react-native, typescript
- Área
- frontend, mobile-dev
Línea de trabajo
Start with GestureHandlerWebDelegate.onActivate and PointerEventManager.pointerDownCallback, then check how cancelsJSResponder is documented and handled on Android and iOS. The reproduction repository shows the failing behavior and expected click behavior. Done when dragging from a Pressable or SVG shape pans without pressing it, while a click without a drag still presses.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
On Android and iOS, a gesture that activates cancels React Native's JS responder (cancelsJSResponder, true by default), so a drag that starts on a Pressable, or on a react-native-svg shape with onPress, only pans. On web the same drag pans, and then the element it started on is pressed when the mouse button is released.
I expected web to match Android and iOS: a drag that activates the pan presses nothing, while a click without a drag still presses.
As far as I can tell, on web a React Native press is the DOM's click: react-native-web's PressResponder calls onPress from onClick, and react-native-svg maps onPress to onClick. The browser fires click because the button went down and up on the same element: pointerDownCallback in PointerEventManager captures the pointer on the pressed element, and the pan carries that element along under the pointer anyway. cancelsJSResponder is accepted on web but never read: GestureHandlerWebDelegate.onActivate only sets the cursor, and nothing stops the click that ends the pointer sequence. Its documentation lists Android and iOS only.
One way to match the native platforms: when a handler with cancelsJSResponder activates, stop the click that ends that pointer sequence with a capture-phase listener on its view, as d3-drag does after a drag. A listener like that in the reproduction, set from the pan's onActivate, removes both presses, and a click without a drag still presses.
Steps to reproduce
- Clone the repository below, run
npm installand thennpx expo start --web, and open the page in Chrome. - With a mouse, press the gray square (a react-native-svg
RectwithonPress), drag about 100 px, and release. - Do the same with the blue square (a
Pressable). - The line above the squares reads "Pans: 2 · Rect presses: 1 · Pressable presses: 1": each drag panned and then pressed the square it started on.
- For comparison, run
npx expo run:androidand swipe from each square: the pan count goes up and neither press count does. A tap on either square presses it on both platforms.
A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.
https://github.com/miniware9/react-native-gesture-handler-web-press-after-pan
Gesture Handler version
3.3.0 (also reproduced with 3.5.0 on web)
React Native version
0.88.1
Platforms
Web
JavaScript runtime
V8
Workflow
Using Expo Prebuild or an Expo development build
Build type
Debug mode
Device
Real device
Device model
Chrome 157 on Debian 13, with a mouse; compared with a Pixel 9a emulator on Android 17
Acknowledgements
Yes
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.8k
- Forks
- 1.1k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 28
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de software-mansion/react-native-gesture-handler
-
GestureDetector should bubble touches if all gestures fail (or some other generalized solution)AbiertoMissing repro Platform: Android Platform: iOS
Dificultad 5/5 Más de una semana Aptitud para principiantes 39/100
software-mansion/react-native-gesture-handler#4714 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[iOS] Crash at app exit: static `_managers` map destroyed while `flushOperations` reads itPosiblemente ocupada @beqramo la tomó hace 5 días. AbiertoMissing info Missing repro Platform: iOS Platform: MacOS
Dificultad 2/5 1-3 horas Aptitud para principiantes 30/100
software-mansion/react-native-gesture-handler#4711 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
[iOS][Fabric] Recognizer of a live handler stays on a recycled view and takes every drag on the component that reuses itPosiblemente ocupada @nihar777 la tomó hace 5 días. AbiertoPlatform: iOS
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
software-mansion/react-native-gesture-handler#4710 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
[iOS] Button press feedback invisible on quick taps when Reduce Motion is enabledPosiblemente ocupada @andreialecu la tomó hace 7 días. AbiertoMissing info Platform: iOS Platform: MacOS
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
software-mansion/react-native-gesture-handler#4707 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
Missing info Platform: Android
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
software-mansion/react-native-gesture-handler#4706 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de software-mansion/react-native-gesture-handler
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ehmpathy/rhachet-roles-bhrain#878 ·
Los mantenedores suelen responder en 1 día
-
Chat UI: Message actions dropdown is cut off beneath composer when message is near bottom of chatPosiblemente ocupada @koeria la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
milind-soni/OpenMausBot#8023 ·
Los mantenedores suelen responder en 1 día
-
Windows microphone listing treats words in a device name as DirectShow labelsPosiblemente ocupada @Sujal-chaudhary la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
clipy-recorder/clipy#447 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement from-app needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
nightly-labs/openbot#19162 ·
Los mantenedores suelen responder en 1 día
-
triage:in-progress
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Cotal-AI/Cotal#11229 · 1 comentario ·
Los mantenedores suelen responder en 1 día