fix: fix tab navigation behavior.
This commit is contained in:
@@ -63,10 +63,8 @@ public class TimePicker : TemplatedControl, IClearControl, IInnerContentControl,
|
||||
nameof(IsReadonly));
|
||||
|
||||
private Button? _button;
|
||||
|
||||
private Popup? _popup;
|
||||
private TimePickerPresenter? _presenter;
|
||||
|
||||
private TextBox? _textBox;
|
||||
|
||||
|
||||
@@ -185,6 +183,29 @@ public class TimePicker : TemplatedControl, IClearControl, IInnerContentControl,
|
||||
IsDropdownOpen = true;
|
||||
}
|
||||
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
SetCurrentValue(IsDropdownOpenProperty, false);
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
if (e.Key == Key.Down)
|
||||
{
|
||||
SetCurrentValue(IsDropdownOpenProperty, true);
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.Key == Key.Tab)
|
||||
{
|
||||
SetCurrentValue(IsDropdownOpenProperty, false);
|
||||
return;
|
||||
}
|
||||
base.OnKeyDown(e);
|
||||
}
|
||||
|
||||
|
||||
private void OnTextChanged(object? sender, TextChangedEventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user