Repository navigation
Labels
area/porting 🖨️Categorizes an issue or PR as relevant for porting of WinUI codedifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIhas-repro-branchhelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugSomething isn't workingplatform/wasm 🌐Categorizes an issue or PR as relevant to the WebAssembly platformproject/items 🧾Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...)
Description
Current behavior
When the ItemsSource on a ListBox is set, no items are populated. However, if the browser is maximised or otherwise resized, the items will populate.
Expected behavior
ListBox is populated as soon as ItemsSource is set.
How to reproduce it (as minimally and precisely as possible)
- Clone this repo: https://github.com/MelbourneDeveloper/RestClient.Net
- Hard reset to Tag UnoIssue1362
- Open the samples solution
- Restore NuGets
- Run the sample RestClient.Net.Samples.Uno.Wasm
- Click the 'Get My Repos' button. Notice that the "Loading..." text comes up quickly and disappears but you do not see any items in the ListBox.
- Resize the browser window
- Notice items show up in the top ListBox
Environment
Windows 10
Firefox (WASM)
Visual Studio
- 2017 (version: 15.9.14)
Anything else we need to know?
This has happened in multiple different projects. It also happens in Edge.
Reacted by Brice Lambson
Metadata
Metadata
Assignees
Labels
area/porting 🖨️Categorizes an issue or PR as relevant for porting of WinUI codedifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIhas-repro-branchhelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugSomething isn't workingplatform/wasm 🌐Categorizes an issue or PR as relevant to the WebAssembly platformproject/items 🧾Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...)
Activity
ghuntley commentedon Aug 13, 2019
Confirming that I've been able to reproduce this in master on the samples app. The problem manifests worst on Edge and happens less with Firefox. This is what I see.
Is this similar to what you see?
MelbourneDeveloper commentedon Aug 13, 2019
@ghuntley it looks like it's in the ballpark. But in my case, I don't see anything in the listbox until I resize the browser. Very easy to see in the sample I posted.
[-]ListBox Doesn't Update Layout On ItemSource Set[/-][+]ListBox Doesn't Display Items[/+]MelbourneDeveloper commentedon Aug 15, 2019
@ghuntley there is an update on this.
I thought the issue might because I was setting the ItemsSource directly rather than using binding. So, I tried creating a ViewModel, and binding to the ItemsSource. I got the same result.
I thought that perhaps the issue was because UpdateLayout was not being called. So, I manually called UpdateLayout after the items were set. Again, same result.
I also tried manually adding an item in to the ObservableCollection to try to wake up: same result.
I also tried in Chrome. Same result.
The problem is very easy to reproduce if you grab my sample.
MelbourneDeveloper commentedon Aug 15, 2019
@ghuntley I switched my sample to a ComboBox so I could get it working. I've tagged the issue UnoIssue1362 so if you grab that commit, you will see the issue.
carldebilly commentedon Aug 29, 2019
I tried the original report (with a ListView & tag
UnoIssue1362) and I confirm I see the bug. I upgradedUno.UIto latest stable version:Reported problem solved.
But I'm not sure the @ghuntley's problem with SampleApps is related...
MelbourneDeveloper commentedon Aug 29, 2019
@carldebilly , @ghuntley thanks for looking in to this. Unfortunately the problem is different with the latest version. The ListBox doesn't show up at all. I made the ListBox red to highlight the issue. You can see it in UWP, but not on Wasm (Firefox, Edge or Chrome).
Wasm (Firefox,Edge,Chrome):

UWP:

Please see the branch here . This has your NuGet upgrades in it.
carldebilly commentedon Sep 3, 2019
Ok I'll reopen this issue.
15 remaining items
[-]ListBox is not implemented[/-][+]`ListBox` is not implemented[/+]docs: Update README.md with the new discord server link (unoplatform#…
test: Reproduce ListBox items not populated after ItemsSource set
MartinZikmund commentedon Apr 7, 2026
Repro generator
Runtime test(s) added in branch
dev/mazi/repro/1362:src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ListViewBase.cs→When_ListBox_ItemsSource_Set_Items_Are_Populated_Without_Resizesrc/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ListViewBase.cs→When_ListBox_ItemsSource_Set_After_Load_Items_Are_PopulatedBoth tests fail on Skia Desktop:
listBoxItems.Count = 0— noListBoxItemcontainers are created in theItemsPanelRooteven after the control is loaded andWaitForIdlecompletes. The bug is cross-platform, not WASM-only.ListBoxdoes not materialize item containers whenItemsSourceis assigned, regardless of timing.MartinZikmund commentedon Nov 7, 2026
Thanks for the report and the repro. Looking at current master,
ListBoxis still essentially a stub:SelectedItems,SelectionMode,SingleSelectionFollowsFocusandScrollIntoVieware still generated[NotImplemented]members (SelectedItemsthrows): https://github.com/unoplatform/uno/blob/1f84af6def1f63bb126d31365bd26daf7361ddf1/src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/ListBox.csListBoxandListBoxItemnow exist inGeneric.xaml, so that earlier gap is closed, but the control logic (container creation, selection, keyboard handling) has not been ported.The earlier repro-branch tests also show no
ListBoxItemcontainers being created on Skia, so this is not WASM-only and not a resize/timing problem. The fix is a port of the WinUIListBoximplementation, so I am leaving this open as a porting task.This was checked as part of an AI-assisted backlog review by reading the code, not by running it. If it looks wrong, please reply and we will take another look.
fix(listbox): Implement ListBox containers and selection (fixes #1362)
fix(listbox): Implement ListBox containers and selection (fixes #1362)
fix(listbox): Implement containers and selection
fix(listbox): Implement containers and selection