Open
Description
Description
When WebView2 navigated to a string and get focused, and then navigate it to an uri, users using IME can't type anything and page will close after two seconds or longer. See this minimum project:
WebView2IMEPageClose.zip
Version
SDK: WinUI 1.0 prerelease2
Runtime: 94, 95
Framework: WinUI in Desktop
OS: Windows 11
Repro Steps
- Run the project above. It first navigate webview to a string which has a textarea that you can input something.
- Click in the textarea to make the webview get focused. This step is important. Without webview getting focused once, you can't reproduce the problem.
- Typing something in the textarea using IME, now everything is OK.
- Click the button above the webview, it navigate webview to a uri pointing to a html which contains the same code to the previous string (actually the string is read from this file)
- Now click in the textarea and try to type something using IME, note that no letters will appear in the textarea and after about two seconds, the page is very likely to close without any reason.
The problem happens when webview's source changes from string to uri. If its sources are always string or always uri, there will be no problem. But since developers may use a same webview to display strings and uris, the problem worth to be fixed.