can't make ScrollViewer vertical scrollbar appear - windows-phone-8

In a Windows Phone 8 app, I have a simple example of a ScrollViewer with an ItemsControl inside
<ScrollViewer>
<ItemsControl ItemsSource="{Binding Items}"/>
</ScrollViewer>
I can swipe up and down and the ItemsControl scrolls accordingly but I am not able to see the vertical scroll-bar.
I do not have any Style applied for ScrollViewers, this is a simple app.
Since the default of VerticalScrollBarVisibility is set to auto shouldn't the scroll-bar be visible?
I am confused, I tried to set it explicitly and it still doesn't work.
How to make it visible?

Is the ItemsControl height actually bigger than the ScrollViewer (thus hiding some items)?
The scrollbars only show up if there are actually hidden items that can only be reached by scrolling.

Related

Material-ui: how to avoid dynamic content "jumping" because of scrollbar?

I have an browser app that dynamically shows content that can be shorter or longer than the available screen size.
On desktop browsers, this causes vertical scrollbar to appear/disappear, which makes the content "jump" left and right.
To avoid this, I add style="overflow-y: scroll" to the body tag, which forces the scrollbar to always display - the scrollbar is just disabled if the content is shorter than the screen.
The problem comes when I use the material-ui SwipeableDrawer component to show a sliding option menu. Viewing the DOM in the browser inspector, it seems material-ui actively removes my overflow-y styling on the body tag when it shows the menu, but then doesn't put it back when it removes the menu.
Example app published on Netlify
Source code
The screen-shot below shows the content is stable at first when the disabled scrollbar is visible, then shows the content jumping left/right after the menu has been displayed.
This only happens on desktop, reproduced with both Chrome and Firefox. It doesn't happen on mobile (iOS, for example) because the scrollbar on mobile devices is displayed "on top" of the content.
I don't want to track what material-ui is doing and add/remove padding - I'm pretty sure material-ui does this behaviour for other components as well (poppers, tooltips, etc.) Tracking all those components and fiddling with padding will be error-prone (not to mention tedious).
Can I somehow make the vertical scrollbar display "on top" of the content like it does in a mobile browser? I'd have to add padding to make sure nothing gets obscured, but at least it'd be static - so once the problem is fixed it'll stay fixed.
One possible workaround is to disable the scroll lock:
<SwipeableDrawer disableScrollLock={true} ... >
A downside of this is that you'll have to remember to do this everywhere you use any material-ui component that has the disableScrolllock functionality - so that means everywhere you use popovers, popups, etc.
But you can override the default props for components. The following worked for SwipableDrawer (because Drawer extends Modal):
export const theme = createMuiTheme({
props: {
MuiModal: {
disableScrollLock: true,
},
},
});
Note: the disableScrollLock setting appears to not be needed anymore with mui (i.e. material-ui version 5) - but you do still need to set style="overflow-y: scroll" in your root body element or somewhere similar.
One possible workaround is to
make the vertical scrollbar display "on top"
by setting the width of the body to the full view:
<body style="width: 100vw;">
This means the body element will extend all the way "underneath" the scrollbar (same as how it works on mobile browsers).
A downside of this is that content that appears on the right hand side of the screen may be obstructed by the scrollbar.

Scrolling gesture passed to elements below element being scrolled

I have an element (lets call this scroll-list-one), which is a list that scrolls vertically. It works great.
I also have another element, which also has a list that scrolls vertically (lets call this scroll-list-two). This occasionally gets presented over scroll-div-one as a popover. This scrolling works great too.
The issue HOWEVER, is that when I scroll scroll-list-two with the swipe touch gesture on mobile, it scrolls scroll-list-two AND scroll-list-one below it.
How do I ensure that the touch gesture doesn't get passed to the element below it? I only want to scroll the top element.
According to this link, the solution is to do the following, which was the solution:
Add -webkit-overflow-scrolling: touch to the top element
Also: strangely this only occurred for ios, was not an issue with android

iOS Fixed Elements Hidden on Input Focus

This wasn't happening previously for me, but I updated to iOS 9.3 two weeks ago and now hidden elements on my web page are hidden when the keyboard is displayed or another input is selected.
Annoyingly a top fixed element is only hidden if the page is scrolled, and the bottom is always hidden. This seems to be a way to 'solve' the issues encountered with fixed elements being left in random positions on the screen when the keyboard is displayed, but now I've got a situation where the elements don't reappear reliably, meaning I lose my main navigation bar for my app.
Is there any way to disable this auto-hiding behaviour? I've created a barebones page that shows the behaviour here: http://128.199.171.247/test.html

UI-select Focus remains

I am using ui-select (Version: 0.8.3, angularjs) library in order to display a drop down list.
I have a situation when i click on a text area there is JavaScript that changes the height of the div to a larger height so it can be scrolled up.
the problem is that when it occures the dropdown remains open and does not close.
after a little of debugging i saw that the OnDocumentClick is not being called once the height is to big.
if i don't change the height of the div, it is working correctly.
Is there any other solution possible?
Thanks.

Disable Scrolling for touch input

I have this xaml in my page:
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<TextBlock Name="Content" IsTextSelectionEnabled="True"
FontSize="20"
TextWrapping="Wrap"
HorizontalAlignment="Right"/>
</ScrollViewer>
There is no option to horizontally scroll with the mouse. However, if I use touch mode (I use the simulator) I can drag the text from left to right with my 'finger'.
If I comment out the ScrollViewer this behaviour stops. I can only assume that Disabled HorizontalScrollBarVisibility is not preventing the touch user from scrolling horizontally. This is a minor annoyance, but how can I prevent this horizontal scrolling?
You'll also want to disable HorizontalScrollMode. HorizontalScrollBarVisibility is a separate property from the one that handles the actual behavior, which I get is a bit strange because 95% of the times you either Disable both or set both to Auto, bit I guess it is just an API design choice that gives you a bit more power.