question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scroll bar should not overlap content

See original GitHub issue

A Scroll Bar Should not Overlap A Component’s Content

Describe the bug

When a ScrollViewer scroll bar is displayed, it overlaps the component’s content.

This is unexpected behaviour, potentially leading to information being hidden.

Steps to reproduce the bug

I added a GridView component to an UWP Page, similar to this:

<Page>
  <GridView ItemsSource="{x:Bind CdList}">
  ...
  </GridView>
</Page>

When I change the window size, the GridView’s vertical scrollbar partially hides/overlaps the rightmost items in the GridView before GridView wraps the items appropriately:

Canvas hidden by scrollbar

Expected behavior

The ScrollViewer’s ItemPresenter should be a sibling of the ScrollViewer’s scroll bars, so, as soon as any of the scroll bars is displayed, the ItemPresenter size should shrink appropriately to spread across only the area left/above the scroll bars.

Scroll bars are supposed to appear outside the presenter area, not within.

Version Info

Windows 10 version Saw the problem?
October 2020 Update (xxxxx) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
robloocommented, Dec 3, 2020

Hidden scrollbars look better from a design standpoint and are the latest convention.

3reactions
robloocommented, Dec 3, 2020

When a ScrollViewer scroll bar is displayed, it overlaps the component’s content. This is unexpected behaviour, potentially leading to information being hidden.

In classic desktop scenarios, yes, it’s expected for the scroll bar to be to the right of the content and never overlap. If you are coming over from WPF this is strange behavior for sure.

However, remember UWP was designed to support mobile devices first. Mobile devices are very limited in horizontal size. This is why the mobile convention soon became for scroll bars to appear on top of content and automatically switch between a ‘traditional’ and minimized ‘panning’ view. Actually, Apple I believe was the first to design scroll bars that behaved this way on the iPhone and everyone just followed that idea. Scroll bars are now expected to automatically hide themselves when not scrolling and only show a small semi-transparent indicator.

So I disagree that it is unexpected – it is expected and necessary from a mobile standpoint. It is also the latest design convention. It may be best to simply set the Padding of the GridView (to 16px I believe) and push the content inward for your case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scrollbar overlaps content of fixed div
I have a fixed div (a shopping cart list) on the right side. If there are too many items, a scroll bar appears....
Read more >
Overflow auto: Scrollbar styling. (making the ...
My idea was to make the scroll bar overlapp the content by setting its position to absolute. So I have been doing some...
Read more >
Fix horizontal scrollbar overlapping content everywhere, ...
Fix horizontal scrollbar overlapping content everywhere, #51296.
Read more >
Prevent Vertical and Horitzonal Scrollbar Overlap in Lower ...
I've been playing with padding and margin and not getting it quite right. I can get close with using padding-right to offset where...
Read more >
DataGrid - A horizontal scrollbar overlaps a grid table
We have a request to allow a grid to be scrolled up far enough that the last row does not get overlapped by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found