uno icon indicating copy to clipboard operation
uno copied to clipboard

`ItemsStackPanel` not playing well with `ItemsControl`

Open erikvilima opened this issue 1 year ago • 3 comments

Current behavior

On Desktop the items are overlaying each other. On Android the ItemsControl doesn't show anything. On WASM nothing is displayed, not even the TextBlock.

Code

<TextBlock Text="ItemsControl" FontSize="20"  Margin="10" />

<ItemsControl ItemsSource="{Binding SampleData}">
  <ItemsControl.ItemTemplate>
    <DataTemplate>
      <TextBlock Text="{Binding}" />
    </DataTemplate>
  </ItemsControl.ItemTemplate>
  <ItemsControl.ItemsPanel>
    <ItemsPanelTemplate>
      <ItemsStackPanel Orientation="Horizontal" />
    </ItemsPanelTemplate>
  </ItemsControl.ItemsPanel>
</ItemsControl>
public class MainViewModel
{
    public List<string> SampleData { get; set; }

    public MainViewModel()
    {
        SampleData = new List<string>
        {
            "Item 1",
            "Item 2",
            "Item 3",
        };
    }
}

Desktop

image

Android

image

WASM

Doesn't show anything at all

Expected behavior

Windows

image

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

Repro app -> UnoApp8.zip

Workaround

Use StackPanel instead of ItemsStackPanel.

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

"Uno.Sdk": "5.2.108"

<UnoExtensionsVersion>4.1.14</UnoExtensionsVersion>
<UnoToolkitVersion>6.0.18</UnoToolkitVersion>
<UnoThemesVersion>5.0.13</UnoThemesVersion>

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

If I use ListView instead of ItemsControl it works everywhere, but Android doesn't. If I use StackPanel instead of ItemsStackPanel it works everywhere.

erikvilima avatar May 01 '24 11:05 erikvilima

cc @dr1rrb, @MartinZikmund, @jeromelaban

agneszitte avatar May 01 '24 13:05 agneszitte

@eriklimakc is this a blocker for a project or a solution please?

agneszitte avatar May 08 '24 16:05 agneszitte

@eriklimakc is this a blocker for a project or a solution please?

No, not a blocker at the moment.

cc @agneszitte

erikvilima avatar May 09 '24 18:05 erikvilima