dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.28k stars 1.76k forks source link

If ListView IsEnabled is false, items and PullToRefresh are still enabled #19366

Open metalium84 opened 11 months ago

metalium84 commented 11 months ago

Description

Items in a ListView are still enabled even if the Listview is disabled. Also PullToRefresh stays enabled.

Steps to Reproduce

    <ListView IsEnabled="False"
              ItemsSource="{Binding Source={x:Static local:MyTest.Instance}, Path=Items}"
              SelectionMode="None"
              IsPullToRefreshEnabled="True">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <HorizontalStackLayout>
                        <Label Text="{Binding Name}" />
                        <Switch IsToggled="{Binding Enabled}" />
                    </HorizontalStackLayout>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

In the code above the Switch should be disabled but you can still toggle the switch. Also the PullToRefresh can be used.

Link to public reproduction project repository

https://github.com/metalium84/dotnet-maui-listview-bug

Version with bug

8.0.3

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

iOS 17.0, macOS 14.1.2

Did you find any workaround?

No response

Relevant log output

No response

ghost commented 11 months ago

Hi @metalium84. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

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.

metalium84 commented 11 months ago

I've added a sample project which allows to easily reproduce the issue. By the way, I found a similar issue which has been closed last year: #6581

PureWeen commented 11 months ago

Duplicate of #6581

ghost commented 11 months ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

XamlTest commented 10 months ago

Verified this on Visual Studio Enterprise 17.9.0 Preview 2(8.0.3). Repro on iOS 17.0 and MacCatalyst, not repro on Windows 11 and Android 14.0-API34 with below Project: MauiTestApp.zip

kubaflo commented 10 months ago

I could also replicate it. Here's a fix: https://github.com/dotnet/maui/pull/20102