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

DeviceInputSystem: Add check for matchMedia in WebDeviceInputSystem #12586

Merged
merged 2 commits into from
May 25, 2022
Merged

DeviceInputSystem: Add check for matchMedia in WebDeviceInputSystem #12586

merged 2 commits into from
May 25, 2022

Conversation

PolygonalSun
Copy link
Contributor

A user in the forum recently found an issue where the error matchMedia is not defined was occurring in an offscreen canvas. Because the offscreen canvas was in a worker thread, it had no context of the Window interface and the matchMedia function. This PR will add a check in the WebDeviceInputSystem to verify the existence of this function before attempting to execute it.

Forum Link: https://forum.babylonjs.com/t/offscreen-canvas-matchmedia/30682/10

@PolygonalSun PolygonalSun marked this pull request as draft May 25, 2022 18:21
@PolygonalSun PolygonalSun marked this pull request as ready for review May 25, 2022 18:26
@azure-pipelines
Copy link

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@azure-pipelines
Copy link

…ystem.ts

Co-authored-by: Gary Hsu <bghgary@users.noreply.github.com>
@azure-pipelines
Copy link

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@PolygonalSun PolygonalSun enabled auto-merge (squash) May 25, 2022 19:58
@azure-pipelines
Copy link

@PolygonalSun PolygonalSun merged commit b3f202e into BabylonJS:master May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants