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

[WASM] ItemsStackPanel used in ItemsControl breaks rendering #8155

Open
hawkerm opened this issue Feb 21, 2022 · 0 comments
Open

[WASM] ItemsStackPanel used in ItemsControl breaks rendering #8155

hawkerm opened this issue Feb 21, 2022 · 0 comments
Labels
area/listview 📃 Categorizes an issue or PR as relevant to the ListView control 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

@hawkerm
Copy link

hawkerm commented Feb 21, 2022

Current behavior

If you use the ItemsStackPanel for the panel of an ItemsControl (instead of a ListView) then rending of the Items Control in WASM completely breaks. It also effects the rendering of other elements within the application when this setup is added.

Expected behavior

Should render and work like a StackPanel or as it does in UWP when the same setup is used.

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

  1. Open the ListView sample of the uno playground
  2. Modified as the following:
<Grid>
    <ItemsControl ItemsSource="{Binding Recordings}">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <!-- Swapping the StackPanel for ItemsStackPanel prevents rendering of the example -->
                <!--<ItemsStackPanel VerticalAlignment="Bottom"/>-->
                <StackPanel VerticalAlignment="Bottom"/>
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>

        <ItemsControl.ItemTemplate>
            <DataTemplate>

                <StackPanel Orientation="Horizontal" 
                            Height="69">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <!-- Random colored circle -->
                    <Ellipse Height="48"
                             Width="48"
                             Fill="{Binding Color}"
                             VerticalAlignment="Center" 
                             Grid.Column="0"/>   

                    <!-- Info -->
                    <StackPanel Orientation="Vertical"
                                VerticalAlignment="Center"
                                Margin="12,0,0,0"
                                Grid.Column="1">

                        <!-- Composition Name -->
                        <TextBlock Text="{Binding CompositionName}"
                                   Style="{ThemeResource BaseTextBlockStyle}"
                                   FontWeight="Semibold"
                                   Foreground="{ThemeResource SystemControlPageTextBaseHighBrush}" />
                        
                        <!-- Artist Name -->
                        <TextBlock Text="{Binding ArtistName}"
                                   Style="{ThemeResource BodyTextBlockStyle}"
                                   Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}" />
                    </StackPanel>
                </StackPanel >
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>

</Grid>
  1. Sample should render as expected.
  2. Comment out the StackPanel and uncomment out the ItemsStackPanel.
  3. Hit run to recompile the sample
  4. Now the page is blank...

Workaround

Use a StackPanel instead. Though eventually waiting for #166 support on the ItemsStackPanel.

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

4.2.0-dev.13 (and whatever uno playground is using)

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@hawkerm hawkerm added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 21, 2022
@jeromelaban jeromelaban added area/listview 📃 Categorizes an issue or PR as relevant to the ListView control project/items 🧾 Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...) and removed triage/untriaged Indicates an issue requires triaging or verification labels Feb 21, 2022
@MartinZikmund MartinZikmund changed the title [WASM] ItemsStackPanel used in ItemsControl breaks rendering [WASM] ItemsStackPanel used in ItemsControl breaks rendering Jul 24, 2023
@MartinZikmund MartinZikmund added difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding and removed difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/listview 📃 Categorizes an issue or PR as relevant to the ListView control 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