Skip to content

Commit

Permalink
fix strongThis comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Komin committed Oct 12, 2023
1 parent f1595a2 commit 8c74e30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dev/WebView2/WebView2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,11 @@ void WebView2::RegisterCoreEventHandlers()
return winrt::FocusManager::FindNextElement(xamlDirection);
}
}();
if (nextElement && nextElement.try_as<winrt::WebView2>() == strongThis)
if (nextElement && nextElement.try_as<winrt::WebView2>() == strongThis->try_as<winrt::WebView2>())
{
// 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.
MoveFocusIntoCoreWebView(moveFocusRequestedReason);
strongThis->MoveFocusIntoCoreWebView(moveFocusRequestedReason);
args.Handled(TRUE);
}
else if (nextElement)
Expand Down Expand Up @@ -1978,4 +1978,4 @@ winrt::UISettings WebView2::GetUISettings()
m_uiSettings = winrt::UISettings();
}
return m_uiSettings;
}
}

0 comments on commit 8c74e30

Please sign in to comment.