Skip to content

fix(listbox): Implement ListBox containers and selection - #26321

Open
Xiaoy312 wants to merge 4 commits into
masterfrom
dev/xygu/20261111/listbox-port
Open

Xiaoy312 wants to merge 4 commits into
masterfrom
dev/xygu/20261111/listbox-port

Conversation

@Xiaoy312

@Xiaoy312 Xiaoy312 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #1362

PR Type:

🐞 Bugfix

What changed? 🚀

On Skia, ListBox was mostly a stub:

  • The default template's VirtualizingStackPanel threw from GetLayouter, so the list rendered empty.
  • Even with a StackPanel as the items panel, there were no ListBoxItem containers, so clicks selected nothing.
  • SelectedItems, SelectionMode, SelectAll, ScrollIntoView and SingleSelectionFollowsFocus were [NotImplemented], and SelectedItems threw.

VirtualizingStackPanel

  • Under a Selector it now borrows ItemsStackPanelLayout, as CarouselPanel already does, so the default ListBox template virtualizes. The layout is created only when the panel virtualizes.
  • Under a plain ItemsControl, which adds the containers itself, it stacks them without virtualizing. WinUI behaves the same way: there, a plain ItemsControl with a VirtualizingStackPanel realizes every item.
  • Orientation is implemented. WinUI's own layout is still not ported.

ListBox

This is a port of ListBox_Partial.cpp (ListBox.mux.cs):

  • ListBoxItem containers.
  • SelectionMode Single, Multiple and Extended. Extended has anchor-based Shift and Ctrl+Shift ranges, and Ctrl toggles.
  • SelectedItems, SelectAll, SingleSelectionFollowsFocus and ScrollIntoView.
  • Keyboard navigation and selection: arrows, Home/End, the Page keys, Space/Enter and Ctrl+A.
  • Changing SelectionMode clears the selection, as WinUI does: its UpdateCVSynchronizationState resets SelectedItem. The SelectionChanged events match WinUI's: Multiple → Single first trims the selection to one item, then clears it, so it raises two.
  • Replacing ItemsSource clears the selection, as WinUI does, including the items that the new source shares with the old one.
  • SelectAll in Single mode throws NotSupportedException (WinUI: E_NOT_SUPPORTED).

Uno's Selector has no multi-selection store; WinUI keeps it in Selector::m_selection. So, as in ListViewBase, SelectedItems holds the selection in Multiple and Extended mode, and SelectedIndex/SelectedItem follow its first item (ListBox.Selection.cs). These behaviors were checked against native WinUI:

  • Item changes:
    • inserting or removing items keeps a multi-selection;
    • removing or replacing a selected item deselects only that item;
    • the panel's layout is refreshed so that the containers follow the items.
  • SelectedIndex/SelectedItem set from code in Multiple or Extended mode select just that item. A SelectedItem value that isn't in the items is rejected, and the selection is left as it was.
  • App changes to SelectedItems:
    • In Single mode they throw InvalidOperationException; WinUI fails them with E_UNEXPECTED.
    • In Multiple or Extended mode, adding an item that isn't in the items, or is already selected, selects nothing. WinUI still shows such an entry in SelectedItems until the next selection change; Uno drops it right away.
  • Large lists: the selection is looked up through a set, and the realized containers are updated in one pass instead of one lookup per selected item.
  • Equal items (["a", "a", "b"]) share one SelectedItems entry, as in ListViewBase. Ctrl+A therefore checks that every item is selected rather than comparing the counts, so a second Ctrl+A deselects them.
  • A SelectionChanged handler can change SelectedItems, as on WinUI, even with another CollectionChanged handler attached. The ListBox now syncs after the collection's handlers, outside of ObservableCollection's reentrancy block. So an app's SelectedItems.CollectionChanged handler still sees the previous SelectedIndex/SelectedItem; SelectionChanged comes after it with the new ones.
  • SelectedIndex set before ItemsSource (as in markup) is applied once the items are available, in every mode, as WinUI does.
  • ListBoxItem.IsSelected set from code in Multiple mode adds or removes just that item.

Selector and automation

  • ScrollIntoView and the SelectedItems filtering log at Debug level when they ignore a request, and VirtualizingStackPanel logs once when it stacks without virtualizing.
  • Selector no longer checks for ListViewBase, ComboBox and ListBox by type. Those classes override three new members:
    • MultiSelectionItems (null for a single selection);
    • ScrollsSelectionIntoView;
    • ScrollItemIntoView.
  • AddToSelection, RemoveFromSelection, IsSelected and SelectorAutomationPeer's selection use MultiSelectionItems, so they also work for a ListBox, and follow the selection mode.
  • ComboBox's managed ScrollIntoView (fast path, then a layouter fallback) moved to Selector, so that ListBox can share it.

Validation

  • Runtime, Skia desktop:
    • The new Given_ListBox and Given_VirtualizingStackPanel cases cover:
      • containers realized, virtualization and ScrollIntoView;
      • SelectedIndex ↔ SelectedItems, and SelectedItems changes raising SelectionChanged;
      • item changes keeping a multi-selection;
      • SelectedIndex/SelectedItem set in a multi-selection mode;
      • SelectedItems changes with another handler attached, and in Single mode;
      • a mode change clearing the selection, with the exact SelectionChanged events, and replacing ItemsSource;
      • SelectAll (also on 5,000 items), and Ctrl+A with equal items;
      • SelectedItems changed from a SelectionChanged handler, SelectedIndex set before ItemsSource, ListBoxItem.IsSelected set from code;
      • the default values, and the items panel swapped at runtime (VirtualizingStackPanel ↔ StackPanel);
      • clicks with modifiers in each mode, the Extended keyboard, and SingleSelectionFollowsFocus=false.
    • The functional cases fail without the change and pass with it. The 5,000-item SelectAll case and the VirtualizingStackPanel-in-a-ScrollViewer case pass both ways; they are regression guards.
    • Given_AccessibleListView's AddToSelection case now also runs for ListBox.
    • The regression set ran before the final SelectedItems change: 287 passed, 0 failed, 21 skipped, 1 inconclusive. It covered Given_ComboBox, Given_FlipView, Given_ListViewBase, Given_Selector, Given_Control, Given_AccessibleListView, Given_AccessibleComboBox, Given_ItemsStackPanel, Given_ListBox and Given_VirtualizingStackPanel. The inconclusive one is When_Large_List_Scroll_To_End_Then_Back_Up_TryClick.
    • At the final head, Given_ListBox, Given_VirtualizingStackPanel, Given_AccessibleListView, Given_ComboBox, Given_FlipView and Given_Selector: 111 passed, 0 failed, 6 skipped. Given_ListViewBase and Given_ListViewBase_Items were run with that set one step earlier, before a last ListBox-only fix: no failures besides the case that fix addressed, 1 inconclusive (When_Large_List_Scroll_To_End_Then_Back_Up_TryClick).
  • Runtime, native WinUI (/winui-runtime-tests):
    • Given_ListBox, Given_VirtualizingStackPanel and the AddToSelection cases: 33/33 pass.
    • The click-with-modifiers, keyboard (including Ctrl+A and SingleSelectionFollowsFocus=false) and touch-hold cases are Uno-only, because the test input helpers can't hold modifiers on WinUI. So the click and keyboard selection semantics follow the WinUI source but weren't compared against WinUI at runtime.
    • The WinUI runs are what showed WinUI clearing the selection on a SelectionMode change or an ItemsSource replacement, applying a SelectedIndex set before the items, and how it handles app changes to SelectedItems.
  • Manual: a new ListBox_SelectionModes sample (category ListBox) switches the selection mode and shows the selection and the SelectionChanged events.
  • Runtime, Skia WebAssembly (Release, headless Edge), at the previous head: Given_ListBox, Given_VirtualizingStackPanel and Given_AccessibleListView: 40 passed, 1 skipped (a mobile-only peer test). The click-with-modifiers, keyboard and touch-hold cases ran there.
  • Not run: Android, iOS.

Not in this PR

PR Checklist ✅

🤖 Generated with Claude Code

@mergify

mergify Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 245548 found UI Test snapshots differences: skia-linux-screenshots: 241, skia-windows-screenshots: 285

Details
  • skia-linux-screenshots: 241 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedVisualsTestbedPage.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • Basics.png-dark
    • Basics.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
  • skia-windows-screenshots: 285 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AnimatedVisualsTestbedPage.png-dark
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • Basics.png-dark
    • Basics.png
    • Buttons.png-dark
    • Buttons.png
    • BasicAcrylicBrushTest.png-dark
    • BasicAcrylicBrushTest.png
    • AnimatedVisualsTestbedPage.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_StructureAndProps.png
    • ContentPresenter_NativeEmbedding.png-dark
    • ContentPresenter_NativeEmbedding.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AutomationProperties_AutomationId.png
    • BenchmarkDotNet.png-dark

Comment on lines +119 to +125
foreach (var container in MaterializedContainers)
{
if (container is SelectorItem selectorItem && IndexFromContainer(container) is var index and >= 0)
{
selectorItem.IsSelected = _selectedItems.Contains(ItemFromIndex(index));
}
}
Comment on lines +331 to +337
foreach (var container in MaterializedContainers)
{
if (container is ListBoxItem { IsSelected: true } listBoxItem)
{
listBoxItem.UpdateVisualState(true);
}
}
Comment on lines +501 to +504
catch (Exception)
{
return;
}
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 245622 found UI Test snapshots differences: skia-linux-screenshots: 217, skia-windows-screenshots: 305

Details
  • skia-linux-screenshots: 217 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppWindowTitleBar Properties.png-dark
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • Buttons.png-dark
    • Buttons.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AnimatedVisualsTestbedPage.png-dark
    • AnimatedVisualsTestbedPage.png
    • AutomationProperties_AutomationId.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_StructureAndProps.png
    • BasicAcrylicBrushTest.png-dark
    • BasicAcrylicBrushTest.png
    • BasicAcrylicBrushTest2.png-dark
    • Basics.png-dark
  • skia-windows-screenshots: 305 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AutomationProperties_StructureAndProps.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • AutomationProperties_StructureAndProps.png-dark
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • AnimatedVisualsTestbedPage.png-dark
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • ContentPresenter_NativeEmbedding.png-dark
    • ContentPresenter_NativeEmbedding.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20261111/listbox-port branch from 13dd4d5 to 3f60a9b Compare November 12, 2026 07:04
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 245656 found UI Test snapshots differences: skia-linux-screenshots: 200, skia-windows-screenshots: 310

Details
  • skia-linux-screenshots: 200 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • Buttons.png-dark
    • ClipboardTests.png-dark
    • AutomationProperties_AutomationId.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • Basics.png-dark
    • Basics.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ComboBox_MaxDropdownHeight.png-dark
  • skia-windows-screenshots: 310 changed over 2496

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedVisualsTestbedPage.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • AutomationProperties_AutomationId.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • AnimatedVisualsTestbedPage.png-dark
    • AutomationProperties_AutomationId.png-dark
    • Buttons.png-dark
    • Buttons.png

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20261111/listbox-port branch from 3f60a9b to 466ca06 Compare November 12, 2026 08:49
@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

XAML Styler drift detected on 466ca06

XAML files under src/SamplesApp/ are not formatted according to src/SamplesApp/Settings.XamlStyler.

To apply automatically (PRs from branches in this repo only): comment /apply-xaml-style on this PR and a bot will push chore: Apply XAML styler to the head branch.

To apply manually (required for PRs from forks):

  1. Download the xaml-style-patch artifact from this run.
  2. In your local checkout of the PR branch:
    git apply xaml-style.patch
    git add -A
    git commit -m "chore: Apply XAML styler"
    git push
    

Or re-run the formatter locally: dotnet tool restore && dotnet xstyler -d src/SamplesApp -r.

Comment on lines +45 to +48
catch (Exception ex)
{
Log($"SelectAll threw {ex.GetType().Name}");
}
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 245689 found UI Test snapshots differences: skia-linux-screenshots: 245, skia-windows-screenshots: 307

Details
  • skia-linux-screenshots: 245 changed over 2498

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AutomationProperties_AutomationId.png
    • AutomationProperties_StructureAndProps.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AnimatedVisualsTestbedPage.png
    • BenchmarkDotNet.png-dark
    • Basics.png-dark
    • BenchmarkDotNet.png
    • Basics.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • CalendarView_Theming.png-dark
  • skia-windows-screenshots: 307 changed over 2498

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedVisualsTestbedPage.png-dark
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • AnimatedBackVisualSourceSamplePage.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_AutomationId.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AppWindowTitleBar Properties.png
    • BasicAcrylicBrushTest.png-dark
    • BasicAcrylicBrushTest.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png

@Xiaoy312 Xiaoy312 removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 12, 2026
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20261111/listbox-port branch from 466ca06 to 06595d2 Compare November 12, 2026 17:59
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 245974 found UI Test snapshots differences: skia-linux-screenshots: 240, skia-windows-screenshots: 312

Details
  • skia-linux-screenshots: 240 changed over 2498

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • Basics.png-dark
    • Basics.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_AutomationId.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • AnimatedVisualsTestbedPage.png
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • CompositionPath.png-dark
    • CompositionPath.png
  • skia-windows-screenshots: 312 changed over 2498

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AutomationProperties_StructureAndProps.png
    • AnimatedVisualsTestbedPage.png
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • AutomationProperties_StructureAndProps.png-dark
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • AnimatedVisualsTestbedPage.png-dark
    • BasicAcrylicBrushTest.png-dark
    • BasicAcrylicBrushTest.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • AutomationProperties_AutomationId.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared ListBox.mux.cs against ListBox_Partial.cpp (winui3/release/1.8.4, dc46907e; the file is identical to the b1db157 cited in the header). OnKeyDown, HandleItemSelection, OnSelectionChanged, ChangeVisualState, the focus handlers, SelectAll and MakeRangeSelection (default anchor 0) match, and the "Uno specific" deviations are all marked. A few differences, none blocking:

  1. Anchor on Replace/Move (OnItemsSourceSingleCollectionChanged). In ListBox::OnItemsChanged, ItemChanged only clears the anchor when index == *m_pAnchorIndex. Here every Replace and Move sets m_pAnchorIndex = null, so replacing an unrelated item loses the anchor and a later Shift-click range starts from 0. Add/Remove are correct (including the multi-item generalisation). Replace could clear only when the replaced range contains the anchor, and Move could be treated as remove + insert.
  2. Click path ignores the focus result. ListBox::OnSelectorItemClicked calls Focus(FocusState_Pointer) and only runs HandleItemSelection if (*pFocused), then calls SetExpectingGotFocusEventFromParentInteraction(TRUE) when the item newly got focus. SelectorItem.OnPointerReleasedPrivate ignores the return value of Focus(FocusState.Pointer) before OnItemClicked, so a non-focusable item still selects. The comment on OnItemClicked acknowledges the split; it may be worth gating on the result (that code is shared with ListView/ComboBox).
  3. Selection is keyed by item, not index. WinUI's m_selection holds indices; SelectedItems here compares with Equals, so equal items (e.g. duplicate strings) share one entry. Documented and consistent with ListViewBase, but is there a test for duplicates?
  4. HandleItemSelection leaves the ElementSoundKind.Invoke request as a TODO (the C++ calls RequestInteractionSoundForElement).

Not reviewed: VirtualizingStackPanel.managed.cs, the Selector_Partial.cs and ComboBox.custom.cs changes, and the test files.

VirtualizingStackPanel threw from GetLayouter on Skia, so any ItemsControl
using it, like the default ListBox template, showed no items. Under a
Selector it now borrows ItemsStackPanelLayout, like CarouselPanel, and
creates it only then; under a plain ItemsControl, which adds the containers
itself, it stacks them without virtualizing, as WinUI does. Orientation is
implemented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Xiaoy312 and others added 3 commits November 25, 2026 15:54
Moves it to Selector so other selectors on a virtualizing panel can use it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ports ListBox_Partial.cpp: ListBoxItem containers, SelectionMode (Single,
Multiple, Extended with an anchor), SelectedItems, SelectAll,
SingleSelectionFollowsFocus, ScrollIntoView, and keyboard navigation and
selection. Uno's Selector has no multi-selection store, so, as in
ListViewBase, SelectedItems holds it and SelectedIndex/SelectedItem follow
its first item; item changes, SelectionMode and ItemsSource changes, and
app changes to SelectedItems behave as on WinUI. Selector's checks for its
subclasses become virtual members, so UI Automation's
AddToSelection/RemoveFromSelection work for a ListBox too.

Fixes #1362

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A manual test page for the selection modes: clicks with modifiers, the
keyboard, SingleSelectionFollowsFocus, SelectAll and item insertions,
with the selection and the SelectionChanged events shown next to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20261111/listbox-port branch from 06595d2 to 41f25fd Compare November 25, 2026 20:55
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 249141 found UI Test snapshots differences: skia-linux-screenshots: 212, skia-windows-screenshots: 276

Details
  • skia-linux-screenshots: 212 changed over 2506

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • ComboBox_MaxDropdownHeight.png-dark
    • ComboBox_MaxDropdownHeight.png
    • Basics.png-dark
    • Basics.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • AnimatedVisualsTestbedPage.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AnimatedVisualsTestbedPage.png-dark
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_AutomationId.png
  • skia-windows-screenshots: 276 changed over 2506

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_Showcase.png-dark
    • AnimatedVisualsTestbedPage.png
    • Basics.png-dark
    • Basics.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • Border_CornerRadius_Binding.png-dark
    • Border_CornerRadius_Binding.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • BreadcrumbBarPage.png-dark
    • BreadcrumbBarPage.png
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • AppWindowTitleBar Properties.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_AutomationId.png
    • BasicAcrylicBrushTest.png-dark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ListBox is not implemented

4 participants