-
Notifications
You must be signed in to change notification settings - Fork 93
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
Orientation lock is not reset during navigation between pages #66
Comments
Running into some spec or browser bugs, bad behavior.
@kaixinjxq want to create test cases for wpt and report to Chrome/spec? |
An easily reproducible bug, for example: with the phone in portrait mode, rotate to 180 then try rotating to 90. The first rotation does nothing but enter fullscreen mode, the second rotation works for a second or 2 then resets everything. |
Different variations with 180 fails: 270 - 180 - 90 fail It fails with AbortError. As 180 (portrait-secondary) completes with success without changing orientation, it makes sense if you read the spec text: https://w3c.github.io/screen-orientation/#dfn-apply-an-orientation-lock
There is probably a pending promise that was never dealt with as it just "completed" |
I've filed #72 to keep track of all these orientation locking bugs. |
Surely looks like a Chrome bug, given that lock('portrait-secondary') succeeds but doesn't rotate and therefore doesn't send 'change' event. Different variations with 180 (portrait secondary) fails, eg. 270 - 180 - 90 fail It fails with AbortError. As 180 (portrait-secondary) completes with success without changing orientation, it makes sense if you read the spec text: https://w3c.github.io/screen-orientation/#dfn-apply-an-orientation-lock
There is probably a pending promise that was never dealt with as it just "completed" Additional annoyance with the orientation lock API, is that the promise resolves before the event is sent. This makes it hard to default handlers that you don't want to call in certain cases, because if you remove the handler then there is no good place to add it back in, because if you do after the promise gets resolves, it might get called as the event is still pending :-( Would be good to file on the spec, plus might also then make sense for the unlock to return a promise. |
Introduced by 8ae7f07
@kaixinjxq @rakuco please take a look.
The text was updated successfully, but these errors were encountered: