diff --git a/Perspex.Controls/DropDown.cs b/Perspex.Controls/DropDown.cs index 0d6e97e442..439a62c06d 100644 --- a/Perspex.Controls/DropDown.cs +++ b/Perspex.Controls/DropDown.cs @@ -7,11 +7,13 @@ namespace Perspex.Controls { using System; + using System.Linq; using Generators; using Perspex.Controls.Primitives; using Perspex.Controls.Templates; using Perspex.Input; using Perspex.Layout; + using VisualTree; public class DropDown : SelectingItemsControl, IContentControl { @@ -93,8 +95,13 @@ namespace Perspex.Controls { if (!this.IsDropDownOpen) { - this.IsDropDownOpen = true; + if (((IVisual)e.Source).GetVisualAncestors().Last().GetType() != typeof(PopupRoot)) + { + this.IsDropDownOpen = true; + } } + + base.OnPointerPressed(e); } protected override void OnTemplateApplied() diff --git a/Perspex.Controls/Primitives/Popup.cs b/Perspex.Controls/Primitives/Popup.cs index 3eabc40b83..99e737cacf 100644 --- a/Perspex.Controls/Primitives/Popup.cs +++ b/Perspex.Controls/Primitives/Popup.cs @@ -139,7 +139,8 @@ namespace Perspex.Controls.Primitives } /// - /// Gets or sets a value indicating whether the popup should stay open when the popup loses focus. + /// Gets or sets a value indicating whether the popup should stay open when the popup is + /// pressed or loses focus. /// public bool StaysOpen { @@ -316,13 +317,6 @@ namespace Perspex.Controls.Primitives { if (!this.StaysOpen) { - var routed = e as RoutedEventArgs; - - if (routed != null) - { - routed.Handled = true; - } - this.Close(); } }