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.06k stars 1.73k forks source link

Group headers randomly disappear on iOS When updated #19372

Open michaelstonis opened 10 months ago

michaelstonis commented 10 months ago

Description

I have a grouped ListView in iOS that when the ObservableCollection is updated will lose the header content. I have tried using an OOTB view cell and a custom cell, but the displayed text is lost in the header group. If the user scrolls or updates the filter, the header will repopulate sometimes.

https://github.com/dotnet/maui/assets/120685/3511fde3-2df0-4508-938e-f1b66257d26a

Steps to Reproduce

  1. Grab the reproduction code.
  2. Tap Hamburger Menu > Reactive UI > Dynamic Data - Filter
  3. Click Load Data
  4. Once data has loaded, type V or Z

Link to public reproduction project repository

https://github.com/michaelstonis/RxMAUI/tree/feature/filter-grouping

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

Affected platform versions

No response

Did you find any workaround?

No.

Relevant log output

No response

ghost commented 10 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.

HansenPeter commented 8 months ago

I'm having the same issue (currently using iOS 17.2 simulator), and have not yet found a solution.

In my case I'm using the Cell.Appearing event to call my backend for more data, and seemingly random group headers will go blank (even if their group content was not updated). Scrolling the group header in and out of view will also randomly make the correct header reappear.

If anyone finds a workaround, please let us know!

tomzeni commented 7 months ago

I'm having the same issue. randomly one our two group headers will disappear... easy to reproduce... on simulator and on real device... imho not usable in this condition... please fix this soon

era-maui commented 7 months ago

We have the same experience. The the cell in the GroupHeaderTemplate also seems to become blank if you rotate the iOS device and do some scrolling

jari-schuurman commented 4 months ago

I also see this happening on Windows; anyone found the solution?

hardikphd commented 4 months ago

We have work around it by replacing Collection with gropping to Expander component with collection as body.


<VerticalStackLayout Spacing="6" BindableLayout.ItemsSource="{Binding CollectionByGroups}">
                <BindableLayout.ItemTemplate>
                    <DataTemplate x:DataType="viewModel:CollectionGroup">
                        <epj:Expander IsExpanded="{Binding IsExpanded}" 
                                      Command="{Binding SelectItemCommand, Source={RelativeSource AncestorType={x:Type viewModel:CollectionByGroupViewModel}}}"
                                      CommandParameter="{Binding .}">
                            <epj:Expander.HeaderContent>
                            <..Header.>
                            </epj:Expander.HeaderContent>
                            <CollectionView >
                                <CollectionView.ItemTemplate>
                                    <DataTemplate x:DataType="viewModel:ItemViewModel">
<..Item Body...>
                                    </DataTemplate>
                                </CollectionView.ItemTemplate>
                            </CollectionView>
                        </epj:Expander>
                    </DataTemplate>
                </BindableLayout.ItemTemplate>
            </VerticalStackLayout>
        where epj is Expander.Maui nuget
prasad210 commented 1 week ago

Any Updates on this issue ??