Arrow keys within the dropdown are handled by the keyboard navigation handler, so detect when this focuses a new item and select it.
@@ -96,6 +96,16 @@ namespace Avalonia.Controls
this.UpdateSelectionBoxItem(this.SelectedItem);
}
+ protected override void OnGotFocus(GotFocusEventArgs e)
+ {
+ base.OnGotFocus(e);
+
+ if (!e.Handled && e.NavigationMethod == NavigationMethod.Directional)
+ e.Handled = UpdateSelectionFromEventSource(e.Source);
+ }
/// <inheritdoc/>
protected override void OnKeyDown(KeyEventArgs e)
{