diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/ComboBoxAutomationPeer.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/ComboBoxAutomationPeer.cs index 8476bfb2e6f..7b426dca759 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/ComboBoxAutomationPeer.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/ComboBoxAutomationPeer.cs @@ -51,16 +51,20 @@ override protected string GetClassNameCore() override public object GetPattern(PatternInterface pattern) { object iface = null; + ComboBox owner = (ComboBox)Owner; if (pattern == PatternInterface.Value) { - ComboBox owner = (ComboBox)Owner; if (owner.IsEditable) iface = this; } else if(pattern == PatternInterface.ExpandCollapse) { iface = this; } + else if (pattern == PatternInterface.Scroll && !owner.IsDropDownOpen) + { + iface = this; + } else { iface = base.GetPattern(pattern); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/GroupItemAutomationPeer.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/GroupItemAutomationPeer.cs index 6d551508d15..e205f79c15f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/GroupItemAutomationPeer.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/GroupItemAutomationPeer.cs @@ -130,14 +130,7 @@ protected override List GetChildrenCore() ItemsControlAutomationPeer itemsControlAP = itemsControl.CreateAutomationPeer() as ItemsControlAutomationPeer; if (itemsControlAP != null) { - Panel itemsHost = owner.ItemsHost; - - if (itemsHost == null) - return null; - - IList childItems = itemsHost.Children; - List children = new List(childItems.Count); - ItemPeersStorage addedChildren = new ItemPeersStorage(); + List children = new List(); bool useNetFx472CompatibleAccessibilityFeatures = AccessibilitySwitches.UseNetFx472CompatibleAccessibilityFeatures; if (!useNetFx472CompatibleAccessibilityFeatures && owner.Expander != null) @@ -152,6 +145,24 @@ protected override List GetChildrenCore() _expanderPeer.GetChildren(); } } + Panel itemsHost = owner.ItemsHost; + + if (itemsHost == null) + { + if (_expanderPeer == null) + { + return null; + } + else + { + children.Add(_expanderPeer); + return children; + } + } + + IList childItems = itemsHost.Children; + ItemPeersStorage addedChildren = new ItemPeersStorage(); + foreach (UIElement child in childItems) {