feat: fix date range start selection when tab into the control.
This commit is contained in:
@@ -458,4 +458,31 @@ public class DateRangePicker : DatePickerBase, IClearControl
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnGotFocus(GotFocusEventArgs e)
|
||||
{
|
||||
base.OnGotFocus(e);
|
||||
FocusChanged(IsKeyboardFocusWithin);
|
||||
}
|
||||
|
||||
private bool _isFocused;
|
||||
private void FocusChanged(bool hasFocus)
|
||||
{
|
||||
// The OnGotFocus & OnLostFocus are asynchronously and cannot
|
||||
// reliably tell you that have the focus. All they do is let you
|
||||
// know that the focus changed sometime in the past. To determine
|
||||
// if you currently have the focus you need to do consult the
|
||||
// FocusManager.
|
||||
|
||||
bool wasFocused = _isFocused;
|
||||
_isFocused = hasFocus;
|
||||
|
||||
if (hasFocus)
|
||||
{
|
||||
|
||||
if (!wasFocused && _start == null)
|
||||
{
|
||||
_start = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user