I've got a ComboBox
as follows:
<ComboBox IsEditable="True"
Width="200"
Height="25"
IsTextSearchEnabled="False"
x:Name="cb"
PreviewTextInput="Cb_OnPreviewTextInput"
ItemsSource="{Binding ItemList}"
Text="{Binding SearchTextText}">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
When Cb_OnPreviewTextInput
is called I set IsDropdownOpen = true
.
In the first attempt (after typing the first letter) the first item on the list is selected and I can go up and down using relevant arrows, the caret is still in the TextBox
.
When I keep on typing at that point, I'm not able to navigate up and down (1 item at time) anymore; at this point the whole ScrollViewer gets focus and I can only go to the bottom or to the top, but not 1 by 1. I have to close the popup e.g. by pressing Escape and then reopen by typing 1 character to be able to go up/down again.
I also noticed that after pressing PageUp the first item gets selected as well, so I tried to mimic that in code, but no luck.
Does anyone know what to do here to be able to navigate up/down and type without problems?