unoplatform / uno.toolkit.ui

A set of custom controls for the WinUI and the Uno Platform not offered out of the box by WinUI, such as Card, TabBar, NavigationBar, etc.
https://platform.uno/
MIT License
83 stars 27 forks source link

[Android] `ItemsRepeater` with `ItemsRepeaterExtensions.SupportsIncrementalLoading` only rendered when interacted #1280

Open eriklimakc opened 2 weeks ago

eriklimakc commented 2 weeks ago

Current behavior

In a specific scenario the ItemsRepeater with ItemsRepeaterExtensions.SupportsIncrementalLoading is only rendered when interacted. If ItemsRepeaterExtensions.SupportsIncrementalLoading is removed then items are rendered when the control is loaded.

<ScrollViewer Background="Red"
              HorizontalScrollMode="Disabled"
              VerticalScrollBarVisibility="Hidden">
    <uer:FeedView Background="Green"
                  Source="{Binding Recipes}">
        <DataTemplate>
            <muxc:ItemsRepeater Background="Orange"
                                ItemTemplate="{StaticResource MyItemsRepeaterTemplate}"
                                ItemsSource="{Binding Data}"
                                utu:ItemsRepeaterExtensions.SelectionMode="Multiple"
                                utu:ItemsRepeaterExtensions.SupportsIncrementalLoading="True"
                                Layout="{StaticResource ResponsiveGridLayout}" />
        </DataTemplate>
    </uer:FeedView>
</ScrollViewer>

As this is a bit specific I'm not really sure if it's a toolkit issue, a FeedView issue, or something else.

A workaround for this is to wrap the whole thing with a <utu:AutoLayout>.

https://github.com/user-attachments/assets/72b9f99e-80c4-477a-a8d9-27fa2e5ae3cb

How to reproduce it (as minimally and precisely as possible)

UnoApp3.zip

Nuget Package:

Package Version(s):

Affected platform(s):

IDE:

Relevant plugins:

Anything else we need to know?

eriklimakc commented 2 weeks ago

@Xiaoy312 would you have an idea?

cc @kazo0

eriklimakc commented 1 week ago

It also works if you wrap the ItemsRepeater in a ScrollViewer, so an example would be:

<ScrollViewer Background="Red"
              HorizontalScrollMode="Disabled"
              VerticalScrollBarVisibility="Hidden">
    <uer:FeedView Background="Green"
                  Source="{Binding Recipes}">
        <DataTemplate>
            <ScrollViewer>
                <muxc:ItemsRepeater Background="Orange"
                                    ItemTemplate="{StaticResource MyItemsRepeaterTemplate}"
                                    ItemsSource="{Binding Data}"
                                    utu:ItemsRepeaterExtensions.SelectionMode="Multiple"
                                    utu:ItemsRepeaterExtensions.SupportsIncrementalLoading="True"
                                    Layout="{StaticResource ResponsiveGridLayout}" />
            </ScrollViewer>
        </DataTemplate>
    </uer:FeedView>
</ScrollViewer>

cc @kazo0 @Xiaoy312