Storybook: deviceorientation event/gyroscope (mobile devices)

Created on 25 Jul 2019  ·  1Comment  ·  Source: storybookjs/storybook

Describe the bug
When trying to use storybook with deviceorientation event, it seems that the event doesn't get fired (not sure but noticed iframes which could be causing/blocking this). Behavior is the same on mobile devices or simulating it with dev tools.

To Reproduce
Steps to reproduce the behavior:

  1. Create component with deviceorientation event, which can be implemented as logging out the DeviceOrientationEvent values alpha, beta, gamma
  2. Write a story for the component and try to trigger the event

Expected behavior
`deviceorientation˙ event should be triggered in a story.

System:

  • OS: Win10
  • Browser: chrome
  • Framework: React
  • Version: "@storybook/react": "^5.1.9"
question / support

Most helpful comment

Issue can be closed.
As it turns out iframe with insecure origin (http) caused trouble receiving device motion/orientation events on mobile devices. Run storybook on localhost (https) server with provided SSL certificate and it should work.

>All comments

Issue can be closed.
As it turns out iframe with insecure origin (http) caused trouble receiving device motion/orientation events on mobile devices. Run storybook on localhost (https) server with provided SSL certificate and it should work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zvictor picture zvictor  ·  3Comments

rpersaud picture rpersaud  ·  3Comments

shilman picture shilman  ·  3Comments

sakulstra picture sakulstra  ·  3Comments

levithomason picture levithomason  ·  3Comments