Skip to content

ComboBox doesn't bring the selected item into view when the dropdown opens #25835

Open

Description

@Xiaoy312

Current behavior 🐛

When a ComboBox has a selected item far down its list (for example, item 237 of 240) and its dropdown is opened, the dropdown shows the top of the list. The selected item isn't realized or visible until the user scrolls to it.

Expected behavior 🎯

Match WinUI: opening the dropdown brings the selected item into view (WinUI centers it in ComboBox::ArrangePopup through SetVerticalOffsetOnCarouselPanel, driven by m_bShouldCenterSelectedItem).

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

  1. A ComboBox with 240 string items.
  2. Set SelectedIndex = 237 while the dropdown is closed.
  3. Set IsDropDownOpen = true.
  4. Uno: the dropdown shows the first items. WinUI: the selected item is in view.

Workaround 🛠️

None verified.

Affected platforms 📱💻🖥️

All platforms 🌍

Uno.Sdk version (and other relevant versions) 📦

Current master.

IDE version 🧑‍💻

N/A

Anything else we need to know? 💬

Uno's ComboBox port calls SetFocusedItem(selectedItemIndex, m_bShouldCenterSelectedItem, forceFocus: true, …) on open, but m_bShouldCenterSelectedItem is never set because the ArrangePopup centering isn't ported. Forcing shouldScrollIntoView: true there isn't enough on its own. The runtime test Given_ComboBox.When_ComboBox_Opened_With_Selection_ScrollIntoView reproduces it.

Activity

  1. added
    kind/bug
    triage/untriaged
    on Oct 29, 2026
  2. Xiaoy312 commented on Oct 29, 2026

    @Xiaoy312
    ContributorAuthor

    Related cleanup to do with the fix: the two existing Given_ComboBox tests that share the same helper, When_ComboBox_ScrollIntoView_SelectedItem and When_ComboBox_ScrollIntoView_SelectedIndex, are excluded on NativeWinUI (and SkiaWasm, flaky per #9080). The WinUI exclusion cites an internal issue, and as far as I can tell these tests have never been run against WinUI.

    When fixing this:

    • Run the three tests (those two plus When_ComboBox_Opened_With_Selection_ScrollIntoView, once its [Ignore] is removed) with /winui-runtime-tests, and drop the NativeWinUI exclusion if they pass. Given_ComboBox has no class-level exclusion, so they will then run on the WinAppSDK CI job.
    • Since fix(Selector): Bring a selection into view only with focus #25834, a list only brings a new selection into view while it has focus (as on WinUI). The two existing tests select while the dropdown is open. WinUI's open path forces focus into an item, so they should still hold, but that's the part to confirm on WinUI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugtriage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions