Skip to content

Commit d82b89a

Browse files
committed
Scope path textbox search to pane content
1 parent 903aff8 commit d82b89a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Main.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,18 @@ private class FilesTab
109109
public FilesTab(AutomationElement Files)
110110
{
111111
// Find window content to reduce the scope
112-
AutomationElement _windowContent = Files.FindFirstChild(cf => cf.ByClassName("Microsoft.UI.Content.DesktopChildSiteBridge"));
112+
var _windowContent = Files.FindFirstChild(cf => cf.ByClassName("Microsoft.UI.Content.DesktopChildSiteBridge"));
113+
var _paneContent = _windowContent.FindFirstChild(cf => cf.ByClassName("InputSiteWindowClass"));
113114

114-
_currentPathGet ??= _windowContent.FindFirstChild(cf => cf.ByAutomationId("CurrentPathGet"))?.AsTextBox();
115+
_currentPathGet ??= _paneContent.FindFirstChild(cf => cf.ByAutomationId("CurrentPathGet"))?.AsTextBox();
115116
if (_currentPathGet == null)
116117
{
117-
// TODO: Fix issue here
118118
Context.API.LogError(ClassName, "Failed to find CurrentPathGet");
119119
}
120120

121-
_currentPathSet ??= _windowContent.FindFirstChild(cf => cf.ByAutomationId("CurrentPathSet"))?.AsTextBox();
121+
_currentPathSet ??= _paneContent.FindFirstChild(cf => cf.ByAutomationId("CurrentPathSet"))?.AsTextBox();
122122
if (_currentPathSet == null)
123123
{
124-
// TODO: Fix issue here
125124
Context.API.LogError(ClassName, "Failed to find CurrentPathSet");
126125
}
127126
}

0 commit comments

Comments
 (0)