react-with-moxy icon indicating copy to clipboard operation
react-with-moxy copied to clipboard

Investigate a better way to resolve jumping scrollbar

Open antoniocapelo opened this issue 8 years ago • 4 comments

From @satazor on July 12, 2017 16:12

Possible solution: https://aykevl.nl/2014/09/fix-jumping-scrollbar

Copied from original issue: moxystudio/react-with-moxy#45

antoniocapelo avatar Nov 13 '17 10:11 antoniocapelo

Can you please tell me how can I replicate this behaviour?

PedroMiguelSS avatar Apr 30 '18 14:04 PedroMiguelSS

I think @antoniocapelo might have more information

satazor avatar Apr 30 '18 15:04 satazor

Possible solution: https://aykevl.nl/2014/09/fix-jumping-scrollbar

While I've found that this is the de-facto solution to this problem according to the internet, it doesn't seem to be a universal fix.

It behaves correctly for elements which don't take up the full width of the viewport, while displaying a nasty gap between the left end of the element and the left edge of the viewport, as can be seen in this pen

A potential solution for the aforementioned issue would be to place the rule in specific elements, as can be seen in this other pen. However, this makes the "fix" conditional and it becomes harder to apply.

However, if my interpretation of the last paragraphs is accurate, the article addresses this issue:

There's one small issue: when using responsive web design (which you should!), it gets quite obvious that the margin at the left is bigger than at the right when the page is made smaller. This won't be an issue on mobile because scrollbars aren't normally shown there, but it just looks ugly on a desktop browser when the browser is resized.

And the solution proposed by the author is to use a media query which makes it so that the rule is only applied if the viewport is wide enough that the gap I mention above is not as noticeable. In my opinion, the gap is still very much noticeable, no matter the width.

In conclusion, is this a valid fix within the context of this project? Please let me know your opinion.

Areadrill avatar Oct 26 '18 16:10 Areadrill

Here's a video demonstrating the problem for reference: https://drive.google.com/open?id=110ThoMGiqvY35yGzJ3FXNSVWf_KpnDb1

satazor avatar Aug 12 '19 11:08 satazor