Skip to content

Commit

Permalink
[Fix] Focusing issue in DateTimePicker
Browse files Browse the repository at this point in the history
Closes #2838
  • Loading branch information
michaelmairegger committed Feb 3, 2017
1 parent 81d2d20 commit 01ae145
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;

/// <summary>
/// Represents a control that allows the user to select a date and a time.
Expand Down Expand Up @@ -177,6 +178,15 @@ protected override string GetValueForTextBox()
return valueForTextBox;
}

protected override void OnPreviewMouseUp(MouseButtonEventArgs e)
{
base.OnPreviewMouseUp(e);
if (Mouse.Captured is CalendarItem)
{
Mouse.Capture(null);
}
}

protected override void OnRangeBaseValueChanged(object sender, SelectionChangedEventArgs e)
{
base.OnRangeBaseValueChanged(sender, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public abstract class TimePickerBase : Control
private Selector _hourInput;
private UIElement _minuteHand;
private Selector _minuteInput;
private Popup _popup;
protected Popup _popup;
private UIElement _secondHand;
private Selector _secondInput;
protected DatePickerTextBox _textBox;
Expand Down

0 comments on commit 01ae145

Please sign in to comment.