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

Improve iframe scrollbars #4048

Open
casey opened this issue Nov 4, 2024 · 0 comments
Open

Improve iframe scrollbars #4048

casey opened this issue Nov 4, 2024 · 0 comments

Comments

@casey
Copy link
Collaborator

casey commented Nov 4, 2024

There's been issues and PRs about this, but I wanted to consolidate them in one place and provide an overview of the situation.

On iframes whose content overflows their element, the browser will draw scroll bars and allow the user to scroll the contents of the iframe with the scroll wheel or touchpad.

In ord iframes originally had scrolling=no, which disables scrolling, but I don't believe disables affects display of scrollbars. On macOS this isn't an issue, because scroll bars are invisible by default, only appearing when the content is actually scrolled. When scrolling is disabled, they never appear. If the user is using a mouse, or the default settings are changed, scrollbars will always appear.

In #3944, someone asked us to enable scrolling on iframes, referencing this inscription, which clearly benefits being able to scroll its content.

We removed scrolling=no from iframe elements in #3947.

In #3990, @gmart7t2 reported that a bunch of inscriptions now had scroll bars.

In #4042, I added scrolling=no back to inscription thumbnail iframes, so every iframe except the main one on /inscription. I also modified the image preview, to make images not overflow the page. This removed scrollbars from all image inscrpitions.

So now, here's where I think we are:

  • Image inscription previews should never have scrollbars. We control how images are rendered, and with the fix from Hide image preview and thumbnail scrollbars #4042, they should never overflow their element.
  • HTML inscription previews (and possibly SVG, I don't know how overflow is handled) may have scroll bars if the inscription author doesn't ensure that they don't overflow their element.
  • Other types of inscriptions I'm not sure about. The rendering code for audio, font, model, PDF, text, unknown, and video inscriptions should never overflow their element. If you see scrollbars on such an inscription, please report it!
  • For markdown and code inscriptions, I think these should probably be allowed to overflow their element, otherwise they'll be unreadable for long content.

Unfortunately, I'm not sure that we can prevent scrollbars from appearing entirely on inscription thumbnails. I don't think this has ever changed though, I think they've always been there.

Is there any cross-browser way that we can hide scrollbars on all inscription previews? I haven't seen a good solution for this.

Should we put scrolling=no back on the main inscription preview on /inscription? I think scrollbars are incredibly ugly, and you can always click on the preview to get it full screen, in which case it will scroll, but some people might want scrolling on the main preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

1 participant