-
Notifications
You must be signed in to change notification settings - Fork 834
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
Automatic update of display orientation does not work properly when turning devices #1195
Comments
+1 This is happening in my iOS app too. |
Not sure if this is the right spot to post this. Live example of the error can be found at: The error did not show on my older devices, an iPad Air II and an iPhone 6s Plus. It did show up on a newer iPad Pro and a newer generic iPad tablet (I can get the model numbers if needed). This link shows how to reproduce the error in the app: This link shows the output of the React ErrorBoundary surrounding the time-picker components during runtime: The relevant code is as follows:
|
If you want to reproduce the error in the app on your end, I have added a .env file that will let you run the client without having to install the backend. The repo is here: |
I have already fixed it. It will be published tomorrow |
Sweet. You guys rock! |
Hey @dmtrKovalenko , thanks for that fast fix! I had a look into it and just observed that it does not tackle the second problem. On my android devices |
Ohh goodness |
Environment
Steps to reproduce
I first observed a crash on iOS devices when turning them into landscape mode. While analyzing that I found a small further issue on Android devices that is caused by the same lines of code. That's why I describe the two observations in the following:
Observation 1
Observation 2
Expected behavior
The DatePicker is shown without an error, preferably as landscape variant.
Actual behavior
Observation 1
An error is thrown: "TypeError: undefined is not an object (evaluating 'window.screen.orientation.angle')"
It seems that the window.screen.orientation api is not supported by iOS Safaris. The code checks that
window.screen
andwindow.orientation
are available but not thatwindow.screen.orientation
is available before accessing it. (seegetOrientation
in useIsLandscape.tsx)Observation 2
On android devices the DatePicker is shown as portrait variant in upside down orientation instead of landscape variant like in regular landscape.
It seems that
window.screen.orientation
equals 270 in upside down landscape instead of -90 as expected. So the check does not apply correctly.Live example
Sorry, I don't have one :(
The text was updated successfully, but these errors were encountered: