Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ItemsStackPanel not playing well with ItemsControl #16531

Open
eriklimakc opened this issue May 1, 2024 · 3 comments
Open

ItemsStackPanel not playing well with ItemsControl #16531

eriklimakc opened this issue May 1, 2024 · 3 comments
Labels
difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding kind/bug Something isn't working project/items 🧾 Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...)

Comments

@eriklimakc
Copy link
Contributor

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.

@eriklimakc eriklimakc added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels May 1, 2024
@agneszitte
Copy link
Contributor

cc @dr1rrb, @MartinZikmund, @jeromelaban

@MartinZikmund MartinZikmund added project/items 🧾 Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...) difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels May 3, 2024
@MartinZikmund MartinZikmund changed the title ItemsStackPanel not playing well with ItemsControl ItemsStackPanel not playing well with ItemsControl May 3, 2024
@agneszitte
Copy link
Contributor

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

@eriklimakc
Copy link
Contributor Author

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

No, not a blocker at the moment.

cc @agneszitte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding kind/bug Something isn't working project/items 🧾 Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...)
Projects
None yet
Development

No branches or pull requests

3 participants