iOS - Landscape to portrait rotation briefly shows removed screen on pop
See original GitHub issueDescription
If we are in landscape mode, pop a screen, and immediately rotate to portrait, the popped screen will still show for half a second ( I assume while it is being unmounted).
Screenshots
mov file most likely won’t play in the browser and needs to be downloaded.
Steps To Reproduce
- Switch to landscape
- Push a screen
- Pop the screen and immediately rotate to portrait
- Observe
Expected behavior
Previous screen should not be visible.
Actual behavior
Popped screen is visible for half a second.
Reproduction
This is the animation config I’m using, which may or not be related. I will try to reproduce with the sample app when I get a chance.
const animationConfig = {
animation: 'spring',
config: {
stiffness: 1200,
damping: 200,
mass: 3,
overshootClamping: true,
restDisplacementThreshold: 0.1,
restSpeedThreshold: 0.1,
useNativeDriver: true,
},
};
const {multiply} = Animated;
const animationInterp = ({current, next, inverted, layouts: {screen}}) => {
const translateFocused = multiply(
current.progress.interpolate({
inputRange: [0, 1],
outputRange: [screen.width, 0],
extrapolate: 'clamp',
}),
inverted,
);
const translateUnfocused = next
? multiply(
next.progress.interpolate({
inputRange: [0, 1],
outputRange: [0, screen.width * -0.8],
extrapolate: 'clamp',
}),
inverted,
)
: 0;
const overlayOpacity = current.progress.interpolate({
inputRange: [0, 1],
outputRange: [0, 0.1],
extrapolate: 'clamp',
});
const shadowOpacity = current.progress.interpolate({
inputRange: [0, 1],
outputRange: [0, 0.3],
extrapolate: 'clamp',
});
return {
cardStyle: {
transform: [
// Translation for the animation of the current card
{translateX: translateFocused},
// Translation for the animation of the card on top of this
{translateX: translateUnfocused},
],
},
overlayStyle: {opacity: overlayOpacity},
shadowStyle: {shadowOpacity},
};
};
Platform
- iOS
- Android
- Web
- Windows
- tvOS
Workflow
- Managed workflow
- Bare workflow
Package versions
package | version |
---|---|
react-native | 0.65.1 |
@react-navigation/native | 5.9.4 |
@react-navigation/native-stack | 5.14.9 |
react-native-screens | 3.9.0 |
react-native-safe-area-context | 3.3.2 |
react-native-gesture-handler | 1.10.3 |
react-native-reanimated | 1.13.2 |
expo | - |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Rotate the screen on your iPhone or iPod touch - Apple Support
Swipe down from the top-right corner of your screen to open Control Center. Tap the Portrait Orientation Lock button to make sure that...
Read more >How to force view controller orientation in iOS 8?
When video is playing, if it's a landscape then allow the screen to rotate landscape right and landscape left. If it's a portrait...
Read more >22 Essential iOS Settings to Help Boost Your iPhone's ... - CNET
To customize the features you'd like to access on the lock screen, launch the Settings menu, tap Face ID & Passcode and enter...
Read more >How to Rotate a Laptop or PC Screen: Flip Your Display on Its ...
Next, click on the “Rotation” pop-up menu and select the amount of desired rotation. Select “Confirm” in the window that appears. You can...
Read more >How to rotate your monitor and use it vertically in macOS
You don't always have to keep a display in a landscape orientation. Here's how you can turn a second screen into a vertical...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We still can’t upgrade to the native navigators as we have some very customized headers, and also we use the same transition animations for iOS and Android (the native android one is pretty bad for our app at least). But yes, we would like to go that route eventually.
things like navigation should’ve been handled by react native team. its been 3 years now we still facing the same issue