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 broken code example in “Managing screen orientation” #33742

Merged
merged 3 commits into from
May 25, 2024

Conversation

Ashish-CodeJourney
Copy link
Contributor

Description

An example given in the api shows:

screen.addEventListener("orientationchange", () => { console.log(The orientation of the screen is: ${screen.orientation}); });

The correct version should be:

screen.orientation.addEventListener("orientationchange", () => { console.log(The orientation of the screen is: ${screen.orientation}); });

the previous information was slight wrong
event type ("change") for listening to orientation changes on the screen.orientation object and accesses the type property of screen.orientation to log the orientation information accurate

Additional details

Related issues and pull requests

@Ashish-CodeJourney Ashish-CodeJourney requested a review from a team as a code owner May 24, 2024 13:23
@Ashish-CodeJourney Ashish-CodeJourney requested review from sideshowbarker and removed request for a team May 24, 2024 13:23
@github-actions github-actions bot added Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed labels May 24, 2024
Copy link
Collaborator

@sideshowbarker sideshowbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch

@sideshowbarker sideshowbarker changed the title #33721 replaced Incorrect reference to screen method with correct one Fix broken code example in “Managing screen orientation” May 25, 2024
Copy link
Contributor

@sideshowbarker sideshowbarker merged commit 72622f8 into mdn:main May 25, 2024
8 checks passed
@sideshowbarker
Copy link
Collaborator

Ashish, great work catching and fixing this, and congrats on landing your first docs change here — welcome aboard 🎉

@Ashish-CodeJourney Ashish-CodeJourney deleted the feature/33721 branch May 27, 2024 06:03
Josh-Cena added a commit that referenced this pull request May 31, 2024
* fix analogy for chained promises

* rewrites

---------

Co-authored-by: Ashish Vaghela <ashish.vaghela@egreycell.com>
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants