Skip to content

Commit 6218ba3

Browse files
Popup fix when selecting value from datepicker inside a popup
Prevents popup from closing when selecting a value from datepicker inside the popup
1 parent bc7307f commit 6218ba3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

MaterialDesignThemes.Wpf/PopupBox.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,12 @@ private static void OnLostMouseCapture(object sender, MouseEventArgs e)
644644

645645
if (Equals(e.OriginalSource, popupBox))
646646
{
647-
if (Mouse.Captured == null || popupBox._popup == null || !(Mouse.Captured as DependencyObject).IsDescendantOf(popupBox._popup))
647+
if (Mouse.Captured == null || popupBox._popup == null)
648648
{
649-
popupBox.Close();
649+
if (!(Mouse.Captured as DependencyObject).IsDescendantOf(popupBox._popup))
650+
{
651+
popupBox.Close();
652+
}
650653
}
651654
}
652655
else

0 commit comments

Comments
 (0)