fix: minor fix for datepicker, simplify code.

This commit is contained in:
Dong Bin
2025-02-28 14:23:30 +08:00
parent 3dd15f57e3
commit 46d1aa6c64
5 changed files with 6 additions and 8 deletions

View File

@@ -222,7 +222,7 @@ public class TimePicker : TimePickerBase, IClearControl
var top = TopLevel.GetTopLevel(this);
var element = top?.FocusManager?.GetFocusedElement();
if (element is Visual v && _popup?.IsInsidePopup(v) == true) return;
if (element == _textBox) return;
if (Equals(element, _textBox)) return;
CommitInput(true);
SetCurrentValue(IsDropdownOpenProperty, false);
}