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

[Windows] Scrollbars Visibility property "Always" is not working consistently in the ScrollView control #7766

Open
Deepak1799 opened this issue Jun 5, 2022 · 11 comments
Assignees
Labels
area-controls-scrollview ScrollView platform/windows 🪟 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@Deepak1799
Copy link

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.
        <ScrollView 
        HeightRequest="200" WidthRequest="200" x:Name="MyScrollView" HorizontalScrollBarVisibility="Never" VerticalScrollBarVisibility="Never">
            <Grid BackgroundColor="Red" x:Name="grid" HeightRequest="400" WidthRequest="400">
            </Grid>
        </ScrollView>
  1. Run the app.
  2. 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

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

NA
@Deepak1799 Deepak1799 added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Jun 5, 2022
@kristinx0211 kristinx0211 added s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Jun 6, 2022
@kristinx0211
Copy link

verified repro on windows with above repro project. 17.3.0 Preview 3.0 [32605.41.main].

@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Jun 6, 2022
@jsuarezruiz jsuarezruiz added this to the 6.0-sr2 milestone Jun 7, 2022
@jsuarezruiz
Copy link
Contributor

Is because the default Scroll Orientation is Vertical. Set the Orientation property to Both value and should works as expected.

@jsuarezruiz jsuarezruiz added the s/needs-info Issue needs more info from the author label Jun 7, 2022
@jsuarezruiz jsuarezruiz self-assigned this Jun 7, 2022
@ghost
Copy link

ghost commented Jun 7, 2022

Hi @Deepak1799. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Deepak1799
Copy link
Author

Hi @jsuarezruiz ,

Thank you for the reply. If the orientation is the problem, the vertical scrollbar should not have this issue with the default orientation of "vertical". However the issue occurs in vertical scrollbar also.

Note: I have tried setting the orientation to "Both" and I am still facing the same issue. I have attached the modified sample here
MauiApp1.zip

I guess there might be a miscommunication. The issue is not about scrollbar is not shown, but it gets automatically hides after a short duration. If the property is "Always", the scrollbar should not auto hide at any moment.

Could you please check and provide your suggestion on this?

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Jun 10, 2022
@hartez hartez modified the milestones: 6.0-sr2, 6.0-sr3, 6.0-servicing Jun 27, 2022
@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@hartez hartez added the area-controls-scrollview ScrollView label Oct 9, 2022
@SuthiYuvaraj
Copy link
Contributor

[Android] Scrollbars Visibility property "Always" is not working consistently in the ScrollView control

I am using MaUI scrollView control and I want to show the scrollbars "always" in the android 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. scrollbar is not always visible
<ScrollView VerticalScrollBarVisibility="Always" HorizontalScrollBarVisibility="Always">

@valimaties
Copy link

I'm facing the same issue, but I don't think it is an issue, more it is like this "should be".
If you'll set the visibility to Always the scrollbar will be visible only when mouse is over it. So for Windows, the meaning for Always is not full-filled IMO. Yes, is there, but not visible. So, this is a OS related issue?

@samhouts samhouts removed the s/verified Verified / Reproducible Issue ready for Engineering Triage label Apr 5, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels May 15, 2023
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.6.0 Preview 7.0. Repro on Windows 11 with below Project:
7766.zip

  1. Run the project
  2. Click Show Scrollbar always
  3. Mouse hover over the red grid
  4. The scrollbar displayed for about 5 seconds and then it is not visible.
    ScrollBar

@jeremy-visionaid
Copy link
Contributor

@valimaties @Deepak1799 A similar issue was raised on the underlying WinUI3 repo:
microsoft/microsoft-ui-xaml#6703

And you can see it happening in the WinUI 3 Gallery app. The settting to make them always visible appears to be an OS setting as far as Windows is concerned:
Settings -> Accessibility -> Visual effects -> Always show scrollbars

@Eilon Eilon removed the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label May 14, 2024
@franklintw1122
Copy link

franklintw1122 commented May 24, 2024

I Solved this problem as below:
Add code in MainPage()

          Microsoft.Maui.Handlers.ScrollViewHandler.Mapper.AppendToMapping("ObviousScrollViewCustomization",
               (handler, view) => {
                   handler.PlatformView.ScrollbarFadingEnabled = false;
                   handler.PlatformView.ScrollBarFadeDuration = 0;
                   handler.PlatformView.ScrollBarStyle = Android.Views.ScrollbarStyles.InsideOverlay;
               });

@BlinkSun
Copy link

@valimaties @Deepak1799 A similar issue was raised on the underlying WinUI3 repo: microsoft/microsoft-ui-xaml#6703

And you can see it happening in the WinUI 3 Gallery app. The settting to make them always visible appears to be an OS setting as far as Windows is concerned: Settings -> Accessibility -> Visual effects -> Always show scrollbars

Omg !!! Thanks you @jeremy-visionaid I was like orthers and think it was a bug with the OS but no, you are right, on Windows, there's a settings to auto-hide ALL Windows scrollbar that build ontop of WinUI after couple seconds. Well, nothing on MAUI (WinUI) that can override the system settings ?
The only way I could style that scrollbar is to add the original style/template in App.xaml in platforms/windows and custom it :
https://github.com/microsoft/microsoft-ui-xaml/blob/winui3/release/1.4-stable/controls/dev/CommonStyles/ScrollBar_themeresources.xaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-scrollview ScrollView platform/windows 🪟 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests