Skip to content

Combobox MaxDropDownHeight has no effect if IsEditable is set to true #10875

@bogdan-patraucean

Description

@bogdan-patraucean

Describe the bug

I can't set the maximum number of items displayed by the combobox dropdown if IsEditable is set to true.

<ComboBox MaxDropDownHeight="400"  IsEditable="True">
     <x:String>Item 1</x:String>
     <x:String>Item 2</x:String>
     <x:String>Item 3</x:String>
     <x:String>Item 4</x:String>
     <x:String>Item 5</x:String>
     <x:String>Item 6</x:String>
     <x:String>Item 7</x:String>
     <x:String>Item 8</x:String>
     <x:String>Item 9</x:String>
     <x:String>Item 10</x:String>
     <x:String>Item 11</x:String>
     <x:String>Item 12</x:String>
     <x:String>Item 13</x:String>
     <x:String>Item 14</x:String>
     <x:String>Item 15</x:String>
 </ComboBox>

MaxDropDownHeight of 400 would display 10 items. I even tried overriding the keyed resource but this still does not work:

<x:Int32 x:Key="ComboBoxPopupMaxNumberOfItems">15</x:Int32> 

Why is this important?

It's important because sometimes, on some screen sizes, 15 items is too much. The fact that the behaviour is inconsistent, in the sense that IsEditable = False will work, makes the combobox an incomplete control.

Steps to reproduce the bug

Just add a combobox with the snippet above.

Actual behavior

MaxDropDownHeight has no effect.

Expected behavior

MaxDropDownHeight should have effect.

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.8.2: 1.8.251003001

Windows version

Windows 11 (24H2): Build 26100

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions