Skip to content

Commit

Permalink
docs: fixup reporting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres committed Aug 3, 2023
1 parent 656b288 commit 5ea7083
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ <h1>Screen Orientation Lock API Demo</h1>

const orientationQuery = window.matchMedia("(orientation: landscape)");

orientationQuery.addEventListener("change", renderUpdate);

screen.orientation?.addEventListener("change", () => {
log(`Orientation changed to "${orientation.type}".`, "event");
const handleOrientationChange = () => {
log(`Orientation changed to "${screen.orientation?.type}".`, "event");
renderUpdate();
});
}

orientationQuery.addEventListener("change", handleOrientationChange);

screen.orientation?.addEventListener("change", handleOrientationChange);

document.addEventListener("fullscreenchange", handleFullscreen);
selector.addEventListener("input", lockOrientation);
Expand Down

0 comments on commit 5ea7083

Please sign in to comment.