-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
fix(Android): onLayout calls in bottom tabs with freezeOnBlur #2363
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember from the top of my head why we have checked there for container is ScreenStack
. Maybe @WoLewicki will have more context here. I'll be able to look into it todays afternoon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm reading this through & came to conclusion that we need better description of the error mechanism here. Why the frame is wrong (what part of it is wrong), why does this interfere with freezeOnBlur
mechanism?
@@ -137,7 +137,7 @@ class Screen( | |||
r: Int, | |||
b: Int, | |||
) { | |||
if (container is ScreenStack && changed) { | |||
if (changed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was added since the logic inside is intended only for native-stack
. So I have no idea why removing it would change anything. Can we have more information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WoLewicki I updated the description with some more information. That's all I got, I'll keep on investigating.
Description
This PR fixes
freezeOnBlur
option not working foronLayout
events with@react-navigation/bottom-tabs
navigator.In bottom tabs
onLayout
is called inside frozen screens. Re-renders don't happen so it seems like freeze itself is working correctly, except for native events. In native stack nothing is called inside frozen screens as expected (note: native stack with fabric keeps one previous screen unfrozen).Comparing both it seems like calling
updateScreenSizeFabric
orupdateScreenSizePaper
makes the difference - effectively stopping native event calls in non-active screens.Fixes #2349
Changes
TestFreeze.tsx
reproChecklist