Skip to content
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

frame does not take screen dimensions with UIModalPresentationOverCurrentContext on orientation change #487

Open
Gregoirevda opened this issue Nov 8, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Gregoirevda
Copy link

Describe the bug
In react-navigation, when using presentation: 'containedTransparentModal' on iPad and changing orientation the modal will not update frame size; it keeps the previous orientation frame size.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://snack.expo.dev/@gregoirevda/containedtransparentmodal-not-updating-after-rotation-ipad
  2. Open the snack with an iPad
  3. Click on Go to Settings
  4. Rotate iPad
  5. frame doesn't update

Expected behavior
frame should update to viewport dimensions

Screenshots

RPReplay_Final1699430541.MP4

Versions (please complete the following information):
"react-native-gesture-handler": "~2.9.0",
"react-native-pager-view": "6.1.2",
"react-native-paper": "^4.7.2",
"react-native-reanimated": "~2.14.4",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.20.0",
"react-native-tab-view": "^3.0.0",
"@react-navigation/elements": "1.3.3",
"@react-navigation/native-stack": "6.6.1",
"@react-navigation/native": "6.0.10",

Smartphone (please complete the following information):

  • Device: iPad
  • OS: 16.3

Additional context
I've tried patching the library without success

@Gregoirevda Gregoirevda added the bug Something isn't working label Nov 8, 2023
@Gregoirevda
Copy link
Author

When wrapping the modal View with

function Modal() {
 const {width, height} = useWindowDimensions()
 
  return <View style={{height, width}}>
     {children}
  </View
}

It updates, but it's really slow.

I also tried wrapping the modal with a native ios UI component which has it's frame fit the screen viewport, but without success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants