From 8c74e30ab439dc5f8b66cac0d65be157b4ad180d Mon Sep 17 00:00:00 2001 From: Dmitriy Komin Date: Wed, 11 Oct 2023 17:30:38 -0700 Subject: [PATCH] fix strongThis comparison --- dev/WebView2/WebView2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/WebView2/WebView2.cpp b/dev/WebView2/WebView2.cpp index aa503985a2..d6ccbb0ed5 100644 --- a/dev/WebView2/WebView2.cpp +++ b/dev/WebView2/WebView2.cpp @@ -597,11 +597,11 @@ void WebView2::RegisterCoreEventHandlers() return winrt::FocusManager::FindNextElement(xamlDirection); } }(); - if (nextElement && nextElement.try_as() == strongThis) + if (nextElement && nextElement.try_as() == strongThis->try_as()) { // 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) @@ -1978,4 +1978,4 @@ winrt::UISettings WebView2::GetUISettings() m_uiSettings = winrt::UISettings(); } return m_uiSettings; -} \ No newline at end of file +}