You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently building an app and I've noticed that when using a Native Stack, along with elements that have position: absolute; top: 0 styling applied, the elements vanish off screen as soon as a backwards transition starts.
I've created a snack which reproduces the issue here, although its a little hard to see at full speed. So I've also created some slowed down videos to showcase the issue
Normal Header (no absolute position)
normalheader_yut8OkV2.mp4
Absolute Header (position: absolute; top: 0)
absoluteheader_KdD3kyd0.mp4
In my example I've chosen to use the Header from @react-navigation/elements as this directly replicates what I was trying to do in my own app, however it can be replaced with any regular absolutely position view. I should also note that its not too jarring in my example due to the lack of other elements on the page; but in a real world scenario with content underneath the header, its quite noticeable.
This issue does not seem to present itself when using @react-navigation/stack.
Expected behavior
All elements on the screen should stay in their current position while the navigation animation is playing.
Hey! Thanks for opening the issue. Seems that this issue is related to react-native-screens library which is a dependency of React Navigation. Can you also post your issue in this repo so that it's notified to the maintainers of that library? This will help us fix the issue faster since it's upto the maintainers of that library to investigate it.
Current behavior
I'm currently building an app and I've noticed that when using a Native Stack, along with elements that have
position: absolute; top: 0
styling applied, the elements vanish off screen as soon as a backwards transition starts.I've created a snack which reproduces the issue here, although its a little hard to see at full speed. So I've also created some slowed down videos to showcase the issue
Normal Header (no absolute position)
normalheader_yut8OkV2.mp4
Absolute Header (
position: absolute; top: 0
)absoluteheader_KdD3kyd0.mp4
In my example I've chosen to use the Header from
@react-navigation/elements
as this directly replicates what I was trying to do in my own app, however it can be replaced with any regular absolutely position view. I should also note that its not too jarring in my example due to the lack of other elements on the page; but in a real world scenario with content underneath the header, its quite noticeable.This issue does not seem to present itself when using
@react-navigation/stack
.Expected behavior
All elements on the screen should stay in their current position while the navigation animation is playing.
Reproduction
https://snack.expo.dev/eaGSwDnMMu9vYdg9taYAx
Platform
Packages
Environment
The text was updated successfully, but these errors were encountered: