iOS: selectable Text edit menu flickers on long-press release (handleLongPress ignores gesture.state)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 88/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- ios, objective-c, react-native
- Área
- mobile
Línea de trabajo
Abre packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm e inspecciona handleLongPress:. Reproduce la pulsación larga sobre Text seleccionable en iOS 16+ con la New Architecture y, a continuación, verifica que el menú de edición siga visible después de soltar, sin parpadeos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
On iOS 16+ (New Architecture), long-pressing a <Text selectable> shows the edit menu ("Copy"), and the moment the finger is lifted the menu animates out and immediately back in. It is a ~100 ms blink on every release, on every selectable Text.
Cause: RCTParagraphComponentView.handleLongPress: does not check gesture.state. A UILongPressGestureRecognizer fires its action on Began and again on Ended (and on Changed when the finger moves). The second call re-runs [_editMenuInteraction presentEditMenuWithConfiguration:], and UIKit dismisses the presented menu before presenting the new one.
- (void)handleLongPress:(UILongPressGestureRecognizer *)gesture
{
if (@available(iOS 16.0, macCatalyst 16.0, *)) {
CGPoint location = [gesture locationInView:self];
UIEditMenuConfiguration *config = [UIEditMenuConfiguration configurationWithIdentifier:nil sourcePoint:location];
if (_editMenuInteraction) {
[_editMenuInteraction presentEditMenuWithConfiguration:config];
}
} else {
// the legacy branch is guarded by `menuController.isMenuVisible`; the iOS 16 branch is not
Fix (verified, see below):
- (void)handleLongPress:(UILongPressGestureRecognizer *)gesture
{
if (gesture.state != UIGestureRecognizerStateBegan) {
return;
}
...
Happy to open a PR if that helps.
Steps to reproduce
- Render
<Text selectable>Some text</Text>in any screen (New Architecture, iOS 16+). - Long-press the text until "Copy" appears.
- Lift the finger.
Expected: the menu stays. Actual: the menu disappears and reappears at touch-up.
Evidence: screen recording of the simulator at 20 fps, OCR of each frame for "Copy" (C = menu visible, . = not):
before: ....CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC..CCCCCCCCCCCCCCCCCCCCCCC....
after: ....CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC....
The gap in the first line is the release (Maestro longPressOn, ~3 s hold). The second line is the same scenario with the one-line guard compiled in (built from source, ios.buildReactNativeFromSource in Expo).
React Native Version
0.86.2 (code unchanged in 0.87.0)
Affected Platforms
Runtime - iOS
Output of npx @react-native-community/cli info
System: macOS 26.2
Xcode: 26.4
iOS Simulator: iPhone 17 Pro
react-native: 0.86.2 (Expo SDK 57), New Architecture, Hermes
Stacktrace or Logs
n/a (visual)
MANDATORY Reproducer
Any <Text selectable> on iOS 16+ with the New Architecture reproduces it; the bug is fully explained by the source above (the action handler is invoked for every gesture state).
Screenshots and Videos
Frame-by-frame OCR trace above.
- Lenguaje dominante
- C++
- Estrellas
- 127k
- Forks
- 25.3k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
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 react/react-native
-
Needs: Author Feedback Needs: Repro
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
react/react-native#58621 · 1 comentario ·
-
Needs: Author Feedback Needs: Repro
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
react/react-native#58610 · 1 comentario ·
-
Needs: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
react/react-native#58565 · 1 comentario · 2 reacciones ·
-
Needs: Author Feedback Needs: Repro
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
react/react-native#58555 · 5 comentarios · 2 reacciones ·
-
Needs: Attention Needs: Repro
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
react/react-native#58526 · 2 comentarios ·
Todos los issues de react/react-native
Issues similares
-
ai_reviewed
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ydb-platform/ydb#53869 · 3 comentarios ·
-
bug cert blocker needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
project-chip/connectedhomeip#74373 ·
-
[request] tracy/0.14.1 Abiertoupstream update
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
conan-io/conan-center-index#31035 ·
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
vllm-project/vllm-ascend#17329 ·