From a5f12be3cf6f34434263e0db5bf590a959239db0 Mon Sep 17 00:00:00 2001 From: Sam Bent Date: Thu, 19 Aug 2021 15:56:30 -0700 Subject: [PATCH] GetClickablePoint returns error value when the element is offscreen --- .../System/Windows/Automation/Peers/AutomationPeer.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Automation/Peers/AutomationPeer.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Automation/Peers/AutomationPeer.cs index 2bc28b44fb5..fb7854bc8f8 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Automation/Peers/AutomationPeer.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Automation/Peers/AutomationPeer.cs @@ -1181,7 +1181,14 @@ public Point GetClickablePoint() try { _publicCallInProgress = true; - result = GetClickablePointCore(); + if (IsOffscreenCore()) + { + result = new Point(double.NaN, double.NaN); + } + else + { + result = GetClickablePointCore(); + } } finally {