Skip to content

ComboBox popup has an incorrect scroll offset after reopening with a variable-height selected item #21971

Description

@zrt2399

Describe the bug

When a ComboBox contains variable-height items, reopening the drop-down with a selected item in the middle of the list can produce an incorrect scroll offset.

The selected ComboBoxItem may already appear at the top of the popup, but the list can still be scrolled further upward. This leaves blank or unrelated space above the item and causes the scrollbar thumb to represent an incorrect position.

The underlying issue also affects VirtualizingStackPanel.ScrollIntoView when scrolling to an unrealized item before the current realized range.

Image

To Reproduce

See the gif

Expected behavior

No response

Avalonia version

12.1.1

OS

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions