Skip to content

Commit ec69ebc

Browse files
authored
Merge pull request #542 from stealthcold/popupbox-fix
Popup fix when selecting value from datepicker inside a popup
2 parents bc7307f + 6218ba3 commit ec69ebc

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)