Skip to content

fix: Fixed scrollbar in example output frame (cherry-pick from #745)#1431

Open
Nwakaego-Ego wants to merge 1 commit into
processing:mainfrom
Nwakaego-Ego:fix/scrollbar-example-frame
Open

fix: Fixed scrollbar in example output frame (cherry-pick from #745)#1431
Nwakaego-Ego wants to merge 1 commit into
processing:mainfrom
Nwakaego-Ego:fix/scrollbar-example-frame

Conversation

@Nwakaego-Ego

Copy link
Copy Markdown
Collaborator

Fixes #716

This is a clean cherry-pick of the relevant fix from #745 by @Its-sunny69 whose branch had carried over unrelated commits.

The fix removes the hardcoded width and height from the iframe in src/components/CodeEmbed/frame.tsx and lets it fill its parent container instead. Before this change, both the parent and the iframe were declaring the same size separately. Now, only the parent controls the size, which removes the confusion that was likely causing Chrome to show unnecessary scrollbars at certain zoom levels.

Note: I could not reproduce the bug locally or on the live site. I also found that index.jsx line 94 already has overflow-hidden on the parent container, which may explain why the bug is hard to reproduce consistently. The fix is still worth merging as it makes the code cleaner.

@doradocodes

Copy link
Copy Markdown
Contributor

@Nwakaego-Ego Since this component is used often, can you double check this change on some of the other pages?
For instance:
https://p5js.org/examples/animation-and-variables-mobile-device-movement/ <- should have a scrollbar on the first example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrolls in example code output frame seems unnecessary

3 participants