-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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: Add width, height attrs to canvas element #32801
Conversation
I think this is another regression caused by the fact that the Playground loads content after You can see that the code sets canvas width and height inside the content/files/en-us/learn/javascript/building_blocks/looping_code/index.md Lines 72 to 75 in 0a3268b
So this page ought to not need this fix once mdn/yari#10770 percolates, and that seems like a better fix since it's not hardcoding the size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #32801 (comment), I'm not sure this fix is needed.
Nice, thanks for checking, let me close for now and we can check if the Yari fix resolved it 👍 |
No, the Yari PR does not seem to have fixed the regression :( |
Linking to a follow-up here to check: |
Description
The canvas element had no width and height attributes applied, so it was looking a little broken. This PR adds them in to the live sample so it looks a little better:
The defaults are 150 x 300: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#attributes
Motivation
Reader reports a strange-looking example.
Related issues and pull requests
#31288