Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diference in behavior from android vs iOS for the RNN.ComponentWillAppear event #7906

Open
1 task done
iurysza opened this issue Aug 15, 2024 · 0 comments
Open
1 task done

Comments

@iurysza
Copy link

iurysza commented Aug 15, 2024

What happened?

Hello there!

If a user has a partially visible modal open (with the overCurrentContext flag) and then sends the app to the background, when bringing it back to the foreground it triggers two willAppear events in React Native. One event is for the modal, and the other is for the modal's parent view.

This is how we listen to the event:

  Navigation.events().registerComponentWillAppearListener(({ componentId }) => {}

This issue is specific to Android. On iOS, only one event is sent, which is related to the modal.

It seems that on Android, these events are triggered by the onGlobalLayout callback at./viewcontrollers/viewcontroller/ViewController.java:308, and not the onHostResume call stack.

While this could be interpreted as intended behavior, iOS only emits one event for the partially visible modal and none for the parent view.

What was the expected behaviour?

Our expectation was that both platforms should behave the same way: either by sending only one event for the top most view or one event for each view that is visible or partially visible.

Was it tested on latest react-native-navigation?

  • I have tested this issue on the latest react-native-navigation release and it still reproduces.

In what environment did this happen?

React Native Navigation version: 7.38.3
React Native version: 0.72.9
Has Fabric (React Native's new rendering system) enabled: (yes/no): NO
Node version: 18.17
Device model: Pixel 8 Pro
Android version: Android 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant