-
-
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
338c25f
added repro
alduzy 13dae87
remove is ScreenStack check
alduzy a56f98d
added missing import
alduzy e483780
code formatting
alduzy 5c9aff2
Merge remote-tracking branch 'origin/main' into @alduzy/tabs-freeze
alduzy 62b8939
revert check removal
alduzy 630f738
changed display value in ref
alduzy 84a4038
Merge remote-tracking branch 'origin/main' into @alduzy/tabs-freeze
alduzy 46a9667
updated repro
alduzy 608e742
revert changes in Screen
alduzy d97871d
fix warning
alduzy 328cae8
removed ScreenStack check once again
alduzy c8aea0f
updated repro
alduzy abea24e
Merge remote-tracking branch 'origin/main' into @alduzy/tabs-freeze
alduzy d26aad7
simplified test
alduzy 0234450
Merge remote-tracking branch 'origin/main' into @alduzy/tabs-freeze
alduzy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs'; | ||
import {NavigationContainer} from '@react-navigation/native'; | ||
import React from 'react'; | ||
import {Text, View} from 'react-native'; | ||
|
||
function HomeScreen() { | ||
return ( | ||
<View | ||
style={{flex: 1, justifyContent: 'center', alignItems: 'center'}} | ||
onLayout={e => { | ||
console.log('[HOME] screen onLayout layout:', e.nativeEvent.layout); | ||
}}> | ||
<Text>Home!</Text> | ||
</View> | ||
); | ||
} | ||
|
||
function SettingsScreen() { | ||
return ( | ||
<View | ||
style={{flex: 1, justifyContent: 'center', alignItems: 'center'}} | ||
onLayout={e => { | ||
console.log('[SETTINGS] screen onLayout', e.nativeEvent.layout); | ||
}}> | ||
<Text>Settings!</Text> | ||
</View> | ||
); | ||
} | ||
|
||
const Tab = createBottomTabNavigator(); | ||
|
||
export default function App() { | ||
return ( | ||
<NavigationContainer> | ||
<Tab.Navigator screenOptions={{freezeOnBlur: true}}> | ||
<Tab.Screen name="Home" component={HomeScreen} /> | ||
<Tab.Screen name="Settings" component={SettingsScreen} /> | ||
</Tab.Navigator> | ||
</NavigationContainer> | ||
); | ||
} | ||
alduzy marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.