Skip to content

Navigate to string then to uri, IME will not work and page will close #1885

Open
@zhuxinghan

Description

@zhuxinghan

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

  1. Run the project above. It first navigate webview to a string which has a textarea that you can input something.
  2. 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.
  3. Typing something in the textarea using IME, now everything is OK.
  4. 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)
  5. 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.

Screenshots
动画

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.

AB#36927816

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtrackedWe are tracking this work internally.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions