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
21.99k stars 1.72k forks source link

If Listview IsEnabled is false, items are still enabled #6581

Closed Symbai closed 9 months ago

Symbai commented 2 years ago

Description

Items in a listview are still enabled even if the Listview (or the parent of the listview) is (should be?) disabled

Steps to Reproduce

<ListView IsEnabled="False"
      ItemsSource="{Binding Source={x:Static local:MyCollection.Instance}, Path=CollectionTest.SubCollection}"
      SelectionMode="None">
    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell>
                <Grid>
                    <Label Text="{Binding Name}" />
                    <Switch IsToggled="{Binding Enabled}"/>
                </Grid>
            </ViewCell>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

In the upper code the Switch should be disabled but the user can still toggle the switch. But I've also tested it with Entry control and its the same.

Version with bug

Release Candidate 2 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11 (Pixel 5)

Did you find any workaround?

No response

Relevant log output

No response

VincentBu commented 2 years ago

repro on Android emulator MauiApp6581.zip

Symbai commented 2 years ago

Note: Also users are able to trigger the refresh (IsPullToRefreshEnabled="true", a RefreshCommand is not set) that should also be disabled if Listview is not enabled.