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

fix: useMeasure to include safer orientation handling #3375

Merged

Conversation

DennisSmolek
Copy link
Contributor

The previous version supported the latest screenOrientation API: https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation

But of course iOS does not support this so was throwing errors.

This adds checks to make sure the objects exists and listeners can be added.

Falls back to depreciated method orientationchange on the window: https://developer.mozilla.org/en-US/docs/Web/API/Window/orientationchange_event

If that doesn't exist either we have to pray the resize events correctly fire.

closes #3371

Copy link

codesandbox-ci bot commented Oct 8, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit dcef11f:

Sandbox Source
example Configuration

@CodyJasonBennett CodyJasonBennett changed the title Fix useMesasure to include safer orientation handling fix: useMesasure to include safer orientation handling Oct 9, 2024
@CodyJasonBennett
Copy link
Member

I'll investigate testing this, but we should upstream and refresh use-measure. Vendored since I don't have access meanwhile.

@CodyJasonBennett CodyJasonBennett changed the title fix: useMesasure to include safer orientation handling fix: useMeasure to include safer orientation handling Oct 9, 2024
@CodyJasonBennett CodyJasonBennett merged commit ddd973b into pmndrs:master Oct 9, 2024
2 checks passed
yukaorange pushed a commit to yukaorange/color-training-app that referenced this pull request Oct 17, 2024
…ating 'screen.orientation.removeEventListener')」が発生、githubのissueにて、r3fにてscreen.orientのAPIを使用しているが、これが存在しないiphoneなんかでエラーになっている様子であった。解決策にしたがい、r3fをアップデートして、解決。pmndrs/react-three-fiber#3375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants