[v7][iOS] Crash when closing react-native's modal when presentationStyle is pageSheet
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- ios, react-native
- Área
- mobile-dev
Línea de trabajo
Comienza con la demo reproducible y añade presentationStyle="pageSheet" en ModalScreen.tsx; después reproduce el fallo al deslizar para cerrar. Lee las ubicaciones del stack trace en RNNEventEmitter.m, RNNModalManagerEventHandler.m y RNNModalManager.m, especialmente la ruta de eventos de modal-attempted-dismiss. Se considera terminado cuando el modal se puede cerrar mediante el gesto de cierre sin fallar, mientras el cierre basado en el estado sigue funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🐛 Bug Report
When using react native's Modal component with presentationStyle="pageSheet" the modal does show and hide, however, when hiding the modal using the "closing gesture" (dragging the view down) the app will crash. If closed through the state change, this does not happen.
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
Check out the repo in the "Reproducible Demo" section, or clone the playground application, and simply add presentationStyle="pageSheet" to the modal located in ModalScreen.tsx and try closing the modal by dragging the screen down.
...
{Platform.OS === 'ios' && (
<Modal
visible={this.state.modalVisible}
presentationStyle="pageSheet" // <--- add this
onShow={() => console.log('===> YES, THIS IS THE CORRECT MODAL, NOW TRY TO DISMISS IT USING SWIPE GESTURE ;)')}
onRequestClose={() => this.setState({ modalVisible: false })}
>
...
In order to trigger this view just press Navigation in the bottom tab, then navigate to Modal or PageSheet modal, finally press "Toggle declared modal" to trigger the default modal.
Expected behavior
Expected the modal would close the same way as when changing the state.
Actual Behavior
Somehow the application crashes, apparently the RRN's modal events get called. Here's the crash dump:
CoreSimulator 783.5 - Device: iPhone 12 mini (********-****-****-****-************) - Runtime: iOS 15.2 (19C51) - DeviceType: iPhone 12 mini
terminating with uncaught exception of type NSException
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
abort() called
Last Exception Backtrace:
0 CoreFoundation 0x7fff203feb94 __exceptionPreprocess + 226
1 libobjc.A.dylib 0x7fff201a1be7 objc_exception_throw + 48
2 CoreFoundation 0x7fff2047ef64 _CFThrowFormattedException + 194
3 CoreFoundation 0x7fff2048945a -[__NSPlaceholderDictionary initWithCapacity:].cold.1 + 0
4 CoreFoundation 0x7fff2046c940 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 251
5 CoreFoundation 0x7fff203fd82b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49
6 myapp 0x10c648747 -[RNNEventEmitter sendModalAttemptedToDismissEvent:] + 119 (RNNEventEmitter.m:135)
7 myapp 0x10c6522d1 -[RNNModalManagerEventHandler attemptedToDismissModal:] + 161 (RNNModalManagerEventHandler.m:21)
8 myapp 0x10c651bd5 -[RNNModalManager presentationControllerDidAttemptToDismiss:] + 133 (RNNModalManager.m:184)
9 UIKitCore 0x7fff24771683 -[UIPresentationController _sendDidAttemptToDismiss] + 119
10 UIKitCore 0x7fff253465f4 __66-[UISheetPresentationController sheetInteraction:didChangeOffset:]_block_invoke.906 + 34
11 libdispatch.dylib 0x7fff2011265a _dispatch_call_block_and_release + 12
12 libdispatch.dylib 0x7fff2011383a _dispatch_client_callout + 8
13 libdispatch.dylib 0x7fff20120c88 _dispatch_main_queue_callback_4CF + 1075
14 CoreFoundation 0x7fff2036c84d __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
15 CoreFoundation 0x7fff203670aa __CFRunLoopRun + 2772
16 CoreFoundation 0x7fff203660f3 CFRunLoopRunSpecific + 567
17 GraphicsServices 0x7fff2c995cd3 GSEventRunModal + 139
18 UIKitCore 0x7fff25059f42 -[UIApplication _run] + 928
19 UIKitCore 0x7fff2505eb5e UIApplicationMain + 101
20 myapp 0x10b898fc8 main + 104 (main.m:7)
21 dyld_sim 0x1102d7ee9 start_sim + 10
22 dyld 0x1193ed4fe start + 462
Your Environment
- React Native Navigation version: 7.25.4
- React Native version: 0.67.2
- Platform(s) (iOS, Android, or both?): iOS
- Device info (Simulator/Device? OS version? Debug/Release?): iOS 15.2
Reproducible Demo
https://github.com/randomBrainstormer/RnnBugExample2
Are you willing to resolve this issue by submitting a Pull Request?
- ✖️ Yes, I have the time, and I know how to start.
- ✖️ Yes, I have the time, but I don't know how to start. I would need guidance.
- ✅ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
- Lenguaje dominante
- MDX
- Estrellas
- 13.2k
- Forks
- 2.6k
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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 wix/react-native-navigation
-
needs triage triage: documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
wix/react-native-navigation#8343 · 1 comentario ·
-
[Fix] searchBar `focus:` true ignored on mergeOptions when searchController already existsPosiblemente ocupada @IsaacIsrael la tomó hace 158 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
wix/react-native-navigation#8318 ·
-
Build Failed with RN 0.87Abiertoneeds triage type: accepted/bug
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
wix/react-native-navigation#8365 · 2 comentarios ·
-
`showOverlay` creates a scene-less `UIWindow`, so overlays never appear under UIScene lifecyclePosiblemente ocupada @yedidyak la tomó hace 4 días. Abiertoplatform: iOS type: accepted/bug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
wix/react-native-navigation#8345 · 2 comentarios · 2 reacciones ·
-
platform: iOS type: accepted/bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
wix/react-native-navigation#8340 ·
Todos los issues de wix/react-native-navigation
Issues similares
-
Type: Possible bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
AntennaPod/AntennaPod#8887 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
work/tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bcgov/bc-wallet-mobile#5035 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
immich-app/immich#33043 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 3 días
-
allow longer time between checksAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100