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

Handle undefined orientation #2143

Merged
merged 2 commits into from
Nov 10, 2024
Merged

Conversation

robknight
Copy link
Member

@robknight robknight commented Nov 10, 2024

In browsers where window.screen.orientation is undefined, provide a default.

window.screen.orientation
window.screen.orientation ?? { type: "portrait-primary" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe we should do window.screen?.orientation for the 3% of devices that don't support it
Screenshot 2024-11-10 at 15 20 55

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @17Amir17

window.screen.orientation
window.screen.orientation ?? { type: "portrait-primary" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @17Amir17

@rrrliu rrrliu enabled auto-merge November 10, 2024 08:42
@rrrliu rrrliu disabled auto-merge November 10, 2024 08:42
@rrrliu rrrliu merged commit 47fa875 into main Nov 10, 2024
1 check passed
rrrliu added a commit that referenced this pull request Nov 10, 2024
In browsers where `window.screen.orientation` is undefined, provide a
default.

---------

Co-authored-by: Richard Liu <[email protected]>
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.

3 participants