Skip to content

Commit

Permalink
Fix compariosn of strongThis with nextElement (strongThis->try_as<win…
Browse files Browse the repository at this point in the history
…rt::WebView2> always gives null)
  • Loading branch information
Dmitriy Komin committed Oct 18, 2023
1 parent 8c74e30 commit 227885f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dev/WebView2/WebView2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ void WebView2::RegisterCoreEventHandlers()
return winrt::FocusManager::FindNextElement(xamlDirection);
}
}();
if (nextElement && nextElement.try_as<winrt::WebView2>() == strongThis->try_as<winrt::WebView2>())
if (nextElement && nextElement.try_as<winrt::WebView2>() == *(strongThis.get()))
{
// If the next element is this webview, then we are the only focusable element. Move focus back into the webview,
// or else we'll get stuck trying to tab out of the top or bottom of the page instead of looping around.
Expand Down

0 comments on commit 227885f

Please sign in to comment.