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

Support breakpoints when iPadOS window frame size changes #209

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

vanstinator
Copy link
Contributor

Summary

Fixes #208

I'm not an iOS developer, but I thought I'd take a stab at figuring out how to handle the iPadOS window frame sizing. I thought it'd be best to do it in a way that works across all iOS products to keep the code simple.

I think the solution here ended up being fairly clean and I was able to test on a physical iPad and an iPhone simulator to validate the breakpoints are working as intended on both operating systems.

Copy link

vercel bot commented Jun 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-unistyles-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 3:11pm

@jpudysz
Copy link
Owner

jpudysz commented Jun 6, 2024

It seems that this change requires min. Expo SDK 50 and React Native 0.73.
I'm fine with that as version 3.0.0 will require React Native 0.75

@jpudysz
Copy link
Owner

jpudysz commented Jun 6, 2024

Apart from that works great!

IMG_7193

@jpudysz jpudysz merged commit 2177f6b into jpudysz:main Jun 6, 2024
3 checks passed
@vanstinator vanstinator deleted the feat/ios-frame-size branch June 6, 2024 13:50
@vanstinator
Copy link
Contributor Author

It seems that this change requires min. Expo SDK 50 and React Native 0.73.

Oh nice catch! Thanks for the quick merge!

@jpudysz
Copy link
Owner

jpudysz commented Jun 6, 2024

Released as 2.8.0-beta.1

@vanstinator
Copy link
Contributor Author

I've been running the beta since the PR merged and this has been working mostly great! There's a small bug I've noticed where minimizing the app on an ipad and then opening it again shows my "mobile" UI before flipping back to the correct breakpoint. So it seems like as the app window is animating while closing/opening unistyles is able to handle RCTWindowFrameDidChangeNotification events yet.

I'll see if I can find some time this week to see if there's anything we can use to ignore events while the app is being minimized/maximized as that should fix the jank when bringing an app back to the foreground.

grifotv added a commit to grifotv/react-native-unistyles that referenced this pull request Nov 17, 2024
As of version 2.8.0 that includes this PR
jpudysz#209 (comment), React Native 0.73 is the minimum supported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breakpoints don't trigger on iPadOS when resizing a window with Stage Manager
2 participants