question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dimensions window support for Split View and Slide Over on iPad

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment: OS: macOS Sierra 10.12.6 Node: 7.2.1 Yarn: 0.24.6 npm: 3.10.10 Watchman: 4.7.0 Xcode: Xcode 9.0 Build version 9A235 Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed) react: 16.0.0-alpha.12 => 16.0.0-alpha.12 react-native: 0.48.4 => 0.48.4

Steps to Reproduce

On on iPad, with the app on “Split View” or “Slide Over”.

console.log(Dimensions.get('screen')) // {fontScale: 1, width: 768, height: 1024, scale: 2}
console.log(Dimensions.get('window')) // {fontScale: 1, width: 768, height: 1024, scale: 2}

(example of console log on iPad Pro 9.7 inch)

Expected Behavior

On iOS Dimensions.get('screen') and Dimensions.get('window') always return the same data. It assuming that the app is always in fullscreen. But on iPad the screen can be share with an other app (Split View), and since iOS, can “float” in a little window over an other app (Slide Over).

Dimensions.get('window') shouldn’t always return Dimensions.get('screen') width and height but the real size of the window.

Actual Behavior

Dimensions.get('window') always return Dimensions.get('screen'), even on “Split View” or “Slide Over”

Slide Over example

capture d ecran 2017-10-01 a 01 32 22

console.log(Dimensions.get('window')) // {fontScale: 1, width: 768, height: 1024, scale: 2}

Split View example 1

capture d ecran 2017-10-01 a 01 32 31

console.log(Dimensions.get('window')) // {fontScale: 1, width: 768, height: 1024, scale: 2}

Split View example 2

capture d ecran 2017-10-01 a 01 33 00

console.log(Dimensions.get('window')) // {fontScale: 1, width: 768, height: 1024, scale: 2}

Reproducible Demo

It can be easily tested on iPad by adding console.log(Dimensions.get('window')) anywhere in an existing app or in a fresh create-react-native-app. And using Split View and Slide Over features of iOS on iPad.

Snack Expo is here : https://snack.expo.io/ryIHToaiW but it need to be tested on an iPad Device or Simulator.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:29
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

14reactions
Gustashcommented, Nov 10, 2018

This issue is still on the latest version of RN. We shouldn’t have to apply workarounds for this. Split screen has been a feature of iOS since version 9. This seems like something that needs fixing urgently

10reactions
rdonnellycommented, Sep 30, 2018

I’ve had a PR open for a few months now and am not sure how to proceed. So far, I’m not getting any traction on getting it merged. If anyone has an idea, please feel free to chime in.

For me, this issue is still valid.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use multitasking on your iPad - Apple Support
Split View : In Split View, two apps appear side-by-side. You can resize the apps by dragging the slider that appears between them....
Read more >
How to use Slide Over and Split View on iPad | iMore
To reposition the size of each Split View, drag on the vertical edit handle in the middle of the screen. Tap and drag...
Read more >
iPad Multitasking - CounterPath
When you use two apps in Split View, both apps adjust in size and run side-by-side. You can adjust the size of the...
Read more >
How to multitask on iPad (iPadOS 15): An ultimate guide
Open two apps/windows in Split View or Slide Over. Touch and hold the image, file, or selected text; it will lift a bit....
Read more >
How to Use Multitasking on Your iPad - PCMag
Both Slide Over and Split View are supported by the iPad Pro, the 5th generation iPad and later, the iPad Air 2 and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found