Prevent invalidateSafeAreaInsets get call when RNCSafeAreaProviderComponentView still in the fabric view pool #629
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…
Currently, RNCSafeAreaProviderComponentView is a fabric view. Fabric view using a reusable for views.
We already had
prepareForRecycle
to clean up the state of view when it was removed from the superview.But we still have 2 things that can affect the state.
The first one is the notification center. We have not removed it. Then
invalidateSafeAreaInsets
still get called when other places show the keyboard. It will lead to_initialInsetsSent
being true, and our lib will not emit an event to js. (We have a return)The second, UIKit still calls
invalidateSafeAreaInsets
when the keyboard shows. So we need a guard to prevent it affect our logic.Summary
We have a problem SafeAreaProvider empty children since
insets
is null, caused by other brownfield screen shows keyboard