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

visuallyHiddenStyle should include initial position to avoid visual bug #28

Closed
MirrorBytes opened this issue Jan 15, 2021 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@MirrorBytes
Copy link

Describe the bug A clear and concise description of what the bug is.

visuallyHiddenStyle in a11y.js should include an initial position of bottom: 0. Without it, it renders under (or sometimes besides) elements in the Router causing scrollbars to appear.

To Reproduce Steps to reproduce the behavior:

  1. Wrap a div with style of height:100vh with Router.
  2. See scrollbar

Please add a link to an example in the Svelte REPL or in a Codesandbox, if you
can.

https://svelte.dev/repl/b4d98fdee025474291747a40a4ed32a7?version=3.31.2

Expected behavior A clear and concise description of what you expected to
happen.

No scrollbar or abnormal sizing issues.

@mefechoel
Copy link
Owner

Thanks for the detailed description and the suggested fix! I'll release a patch in the next days.

@mefechoel mefechoel added the bug Something isn't working label Jan 15, 2021
@mefechoel
Copy link
Owner

So, I've tried you're example and noticed, that the scrolling was not happening because of the status area, but because of a padding on the body element. That's what browsers do by default...

Please try and add this to your App component and see if it fixes the issue:

<style>
  :global(body, html) {
    padding: 0;
    margin: 0;
  }
</style>

CSS resets also often take care of this, so you could try one of those if you prefer.

@MirrorBytes
Copy link
Author

MirrorBytes commented Jan 15, 2021 via email

@mefechoel
Copy link
Owner

Alright, good to know. I'll look into it further.

@MirrorBytes
Copy link
Author

MirrorBytes commented Jan 15, 2021

I have a feeling it's a bit of both here. In a vanilla environment it's the padding, but in a reset environment it's the status bar. I'll float with both for now and update this if I can find if there's something else going on.

Edit: well I found the culprit... I had a wrapper element like 6 layers deep with a hidden border. Still weird how the bottom: 0 fixed that though.

@mefechoel
Copy link
Owner

This should be fixed with 3.1.5. Please try if it works for you now.

@mefechoel
Copy link
Owner

Oh ok, missed the edit. It's probably still a good idea to move the status div off screen and out of the scrolling flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants