w3c / screen-orientation

The screen orientation lock specification
https://w3c.github.io/screen-orientation/
Other
27 stars 29 forks source link

Example of usage is incorrect #245

Closed Maferep closed 1 year ago

Maferep commented 1 year ago

Could there be an error in Example 1? getOppositeOrientation() uses the line screen.orientation.startsWith("portrait") as if screen.orientation returns a string, when it actually returns an object with the type (so the command worked for me if i wrote screen.orientation.type.startsWith("portrait"). I would appreciate guidance on this matter if I'm wrong.