[Windows] Scrollbars Visibility property "Always" is not working consistently in the ScrollView control
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 290
Description
### Description
I am using MaUI scrollView control and I want to show the scrollbars "always" in the windows platform if the content size is more. So I am using the scrollview properties "HorizontalScrollBarVisibility" and "VerticalScrollBarVisibility" as "Always". However the scrollbar fades away after sometimes. This issue occurs consistently when changing the scrollbar visibility at the runtime, and happens sometime when setting the scrollbar visibility at the compile time.
### Steps to Reproduce
1. Create a MaUI App.
2. Add a scroll View control, keep a large size content inside the scroll viewer.
```
```
3. Run the app.
4. In a button click, set the scrollbar visibility (horizontal and vertical) to always. It will not show the scrollbar always, and the scrollbars will fade away after few seconds.
```
private void Button_Clicked(object sender, EventArgs e)
{
MyScrollView.HorizontalScrollBarVisibility = ScrollBarVisibility.Always;
MyScrollView.VerticalScrollBarVisibility = ScrollBarVisibility.Always;
}
```
**Repro sample is attached here:**
[MauiApp1.zip](https://github.com/dotnet/maui/files/8839600/MauiApp1.zip)
If you are using the sample, Run the sample --> Click the button "Show Scrollbar always". Then test the mentioned scrollbar visibility behavior.
### Version with bug
6.0 (current)
### Last version that worked well
Unknown/Other
### Affected platforms
Windows, macOS
### Affected platform versions
Windows SDK 10.0.19041
### Did you find any workaround?
No
### Relevant log output
```shell
NA
```
Contributor guide
Research direction
Start by running the attached MauiApp1.zip sample on Windows with the ScrollView content and button-click steps from the issue. Trace the runtime changes to HorizontalScrollBarVisibility and VerticalScrollBarVisibility, then verify behavior on the listed Windows and macOS platforms. Done means setting both properties to Always keeps the scrollbars visible when the content is larger than the ScrollView.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100