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

Does not function on certain devices #16

Closed
Radilx opened this issue Aug 22, 2018 · 21 comments
Closed

Does not function on certain devices #16

Radilx opened this issue Aug 22, 2018 · 21 comments

Comments

@Radilx
Copy link

Radilx commented Aug 22, 2018

Hello!

It works perfectly in the iOS simulator; however, I have tested on a physical device (both iPhone and iPad) and it does not render.

In fact, trying to present the popover actually crashes the app with no error... it just freezes. I really liked this library but this is a deal-breaker. I am building with Xcode 9.4.1

@Radilx
Copy link
Author

Radilx commented Aug 22, 2018

Okay, further inspection reveals that it's not crashing the app, it just seems like it's rendering incorrectly and covering the entire screen. I can still interact with alerts, but the rest of the page cannot be touched.

@surendharreddy
Copy link

Thanks for reporting it @SM-Wistful, I also faced this issue in production. In my case, it was working fine on iPhone X but not on other iOS devices.

@SteffeyDev
Copy link
Owner

@SM-Wistful Can you download my Test App (https://expo.io/@steffeydev/popover-view-test-app) on those physical devices and see if it works inside there? You will need to download the Expo app first.

@SteffeyDev
Copy link
Owner

If it works inside the test app but not in your app, I invite you to look at the test app source code to see if you can find the difference, and I would be happy to help you in that, as I want this library to work in as many situations as possible. If it does not work in the test app, let me know what models don’t work and I will try to get a hold of the device to test on.

@SteffeyDev
Copy link
Owner

I just pushed an update with a number of fixes, check out version 1.0.7 to see if the issue still persists. If it does, please check out my troubleshooting steps above.

@Radilx
Copy link
Author

Radilx commented Aug 25, 2018

Hi! Sorry for taking so long to get back to you on this. I don't have my iPad available right now, but I will test it tomorrow and let you know. Thanks for all the work you are doing on this :)

@Radilx
Copy link
Author

Radilx commented Aug 25, 2018

Hi! It seems to be working on my iPhone; however, it is still broken on the iPad :/

Are there any logs I can send that will help you address this?

@SteffeyDev
Copy link
Owner

No logs, but did you try out the expo test app?

@SteffeyDev SteffeyDev changed the title Major issue -- does not work on iOS physical devices Does not function on certain devices Aug 27, 2018
@Radilx
Copy link
Author

Radilx commented Aug 28, 2018

I can do that, but it seems unlikely my app is the issue. The exact same app works perfectly on iPhones, but breaks when I run it on an iPad...

@SteffeyDev
Copy link
Owner

That’s fine, my test app will give you a range of popovers to test on device so we can try and pinpoint the exact issue

@hawkrives
Copy link
Contributor

@SteffeyDev I can also now reproduce this, on my iOS 9 iPad mini. I will try to run the expo app this evening.

@drewvolz
Copy link
Contributor

I enabled debug in react-native-popover-view and it appears we're sitting on measureContent().

The last line in debug is from Popover.js line 145.

measureContent(requestedContentSize) {
if (requestedContentSize.width && requestedContentSize.height && !this.waitForResizeToFinish) {
if (this.state.isAwaitingShow) {
if ((this.props.fromView && !this.state.fromRect) || !this.getDisplayArea() || !this.safeAreaViewReady) {
if (DEBUG) console.log("measureContent - Waiting - requestedContentSize: " + JSON.stringify(requestedContentSize));
setTimeout(() => this.measureContent(requestedContentSize), 100);

measureContent - Waiting - requestedContentSize

Log Line
componentWillReceiveProps - Awaiting popover show Popover.js 503
setDefaultDisplayArea - newDisplayArea: {"x":10,"y":10,"width":394,"height":716} Popover.js 58
measureContent - Waiting - requestedContentSize: {"y":0,"width":257,"x":0,"height":653} Popover.js:145
measureContent - Waiting - requestedContentSize: {"y":0,"width":257,"x":0,"height":653} Popover.js 145

@SteffeyDev
Copy link
Owner

I don't have a way of testing against older iOS versions, but it may have to do with RN's SafeAreaView on older versions. @drewvolz Try putting if (DEBUG) console.log(this.safeAreaViewReady); after line 145, this will tell us if that is the issue. If it is, I can make the safeAreaView check only active on iOS versions >= 11.

@SteffeyDev
Copy link
Owner

According to facebook/react-native#17638 and facebook/react-native#18255, it looks like SafeAreaView does not support iOS 10 and below. I'll either add a version check or switch to https://github.com/react-community/react-native-safe-area-view.

@SteffeyDev
Copy link
Owner

I'm downloading iOS 10.3.1 and iOS 9.3 simulators now so I can test

@drewvolz
Copy link
Contributor

@SteffeyDev adding if (DEBUG) console.log(this.safeAreaViewReady); after line 145 on iOS 9.3 comes back as true when trying to activate the popover.

@SteffeyDev
Copy link
Owner

Ok, thanks for testing that. It looks like RN’s SafeAreaView just doesn’t do anything on versions older than iOS 11, so I’m switching to react-native-safe-area-view, which unfortunately has a number of drawbacks in it’s own implementation, so once I find a way to accomadate those I will be able to push a fix.

@drewvolz
Copy link
Contributor

Let us know if there's anything we can do to help. We appreciate you looking into switching to react-native-safe-area-view and dealing with the unfortunate drawbacks.

SteffeyDev added a commit that referenced this issue Sep 14, 2018
@SteffeyDev
Copy link
Owner

Ok, check out v1.0.9 and let me know how it works for you!

@drewvolz
Copy link
Contributor

drewvolz commented Sep 14, 2018

v1.0.9 does fix the issue we were seeing with iOS 9 👍

@Radilx
Copy link
Author

Radilx commented Sep 14, 2018

Yeah, I can confirm that this update fixes it on iOS 9!! Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants