Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinUI3 WebView2 mouse stop working while keyboard is still working. #3003

Closed
applefanbois opened this issue Nov 25, 2022 · 95 comments
Closed
Assignees
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@applefanbois
Copy link

applefanbois commented Nov 25, 2022

There are 2 ways to replicate the problem.
It is new to the latest version stable version of WebView2.

-Click in an web page input box and type super fast.
or
-Select text in a page and Ctrl + c multiple times super fast.

The webview2 and the app will look like it is crashed and froze.
It is not frozen, keyboard is still working.
You can continue to type in the input box.
You can tab to change inputs.
You can even zoom with the keyboard.
CPU usage is zero.
The mouse does not work at all in the whole app, giving the illusion it is frozen.
So you can click in the webpage or the app part and it will do nothing.
I have not found a way to unstuck it.

The problem happens 5 times per hours for a normal user.
Typing fast is jus a way to make do the problem faster.
WebView2 is now unusable.

-Latest update of Windows 10 Pro version 22H2 build 19045.2311
-Also happening on Windows server 2022
-Microsoft.Windows.SDK.BuildTools 10.0.22621.755
-Microsoft.WindowsAppSDK 1.2.221116.1
-Microsoft Edge WebView2 Runtime 107.0.1418.42

--------------------- 2 cents
PS : If you are a developer and you are planning on using webview2 or any Microsoft SDK... don't
We already lost 200 000$ trying to make the MS SDK work and it never does.
Go with QT or anything else.
I wish I could go back in time and tell my younger self to stay away from any MS SDK.
If you do go with MS SDK, you will forever loose your sanity.
We have the exact same app with almost exact same code on iOS and macOS and never had any problems.

Pleas MS or anyone working on this : just make it work like QT, iOS, macOS, Android SDK.
I do not deserve this mental torture. My boss is so depressed that the app 4 years later is still not functional on Windows.
We are forced to ask our customers to buy Apple product to use our app.

AB#43086528

@applefanbois applefanbois added the bug Something isn't working label Nov 25, 2022
@applefanbois
Copy link
Author

If you type too fast in a web page input box, you select text and do many Ctrl-V or simply use the webview2 normally it will deactivate all mouse input in the whole app. A friend across the globe reported the exact same problem.

As of now, the webview2 is useless and so is our app.

Waiting for MS to fix it.

WebView2 disable all mouse inputs.
WebView2 freeze the whole app. (this is an illusion)

@ghord
Copy link

ghord commented Dec 21, 2022

Hitting the same issue. Any updates?

@applefanbois
Copy link
Author

applefanbois commented Dec 21, 2022

We are now officially 3 people around the planet who reported this problem. The other person is a friend of mine in another country. This is the scariest bug, you can't give an app with this problem to your customers.

I feel like I am crying for help in a desert. You cannot use WebView2 for more than 5 minutes without everything freezing. How can nobody noticed? because no one actually use it? The potential is there, WebView2 could be amazing, but we on the UWP/Win32/Reunion side are abandoned in favour of WPF (who gets all the bell and whistles).

@ghord
Copy link

ghord commented Dec 21, 2022

One thing I've noticed is that this only appears in WinUI3. When running Win32 WebView sample this issue doesn't appear. It seems to be connected with WinAppSdk 1.2. When I've tried older version (1.1.5) it does work without issues.

I've created new issue in WinAppSdk repository: microsoft/WindowsAppSDK#3266

@applefanbois
Copy link
Author

Indeed, thanks maybe it is related to WinUI3.
I just hope they fix it as soon as possible.

@applefanbois
Copy link
Author

The problem is still there in
Microsoft.WindowsAppSDK 1.2.221209.1

@Eilon
Copy link

Eilon commented Jan 5, 2023

Please refer to microsoft/WindowsAppSDK#3266 (comment) for a trivial WinUI3 + WebView2 repro.

@nathanjeynes
Copy link

This is affecting our blazor app in .net MAUI and means we cant release into production. This issue with the webview needs fixing asap.

@sebestyn168
Copy link

sebestyn168 commented Jan 7, 2023

I left only one text field in my poc hoping it wont be rejected

Another issue I found with input date : open the calendar and move the window - the calendar stay still
Well actualy, move the window then open the calendar it is located at the previsous window location.
Then switch app and come back to reopen the calendar and it correctly positionned
Same thing with the options in a select

@baaaaif
Copy link

baaaaif commented Jan 9, 2023

we're affected too
--> upvote...

@sebestyn168
Copy link

This should not even require upvote.
How many software are viable when the mouse crashes?
There might be even more dreadfull bugs requireing even more attention but asking for upvoting like otherwise this one might not been fixed is just annoying.

I don't know if it might help: I noticed that even the Debug tools can't select elements when the problem occurs

@NeilQ
Copy link

NeilQ commented Jan 17, 2023

same issue and upvote...

@applefanbois
Copy link
Author

WebView2 in its version 1.1 is so unstable, navigating make it crash, just reading text on a webpage makes it crash, plenty of memory violation... All the WebView2 are in a totally broken and useless state. MS managed to make Chromium unstable and broken.

Please fix it, our (your users) are suffering. Our customers on windows are suffering and they know the iOS/macOS version is working all the time. That is why we have more and more users buying Macs. 4 years later, we still don't have a working WebView on MS. Do I need to remind you that WEB is the #1 priority in a framework?

@Avenged
Copy link

Avenged commented Jan 18, 2023

I'm having the same issue. Any updates?

@applefanbois
Copy link
Author

Just wait for another year or move your project to GTK, QT, Electron, pure Web if you can.
We made a bad decision to make an app on an abandoned OS with the official non-working framework.
Remember that MS just back stabbed everyone by killing UWP thus killing HoloLens.
You invest your hard work on Microsoft and you get punished.
Sadly we never learn, because we won't accept the situation : Windows is a platform to run legacy code only.

Even Microsoft is not using their own SDK/Framework.
All their recent app are running in Electron.

Move your app to Android and it will run natively on Windows 11 through the Amazon app store.
Microsoft knows that its too late, so Windows invested a lot of ressources in running Android apps natively.

The future is only mobile and web. If you swim against the current, you will eventually drown.

Good luck.

@KieranDevvs
Copy link

How on earth has this not been addressed yet? How many likes and comments does an issue have before a team member even reads it? This is the problem with "feedback" repositories, we can't see what you're doing and it looks... well to put it bluntly... like you're doing absolutely nothing.

Hire a community support manager or make the project open source, because this system clearly just isn't cutting it...

@applefanbois
Copy link
Author

Laugh, and the world laughs with you;. Weep, and you weep alone

@tofuandeve
Copy link
Contributor

Hi all, thank you for reporting the issue. We are looking into this issue, however was unable to reproduce the issue with our internal WinUI3 test app. We will try with the sample @Eilon provided and update the status of the issue.
Thank you.

@tofuandeve
Copy link
Contributor

I have tried with the sample code @Eilon provided and the issue still doesn't repro, the webview runtime version I am using is 109.0.1518.52.
Could you please try with that version of WebView2 runtime to see if you still see the issue @applefanbois ?

@baaaaif
Copy link

baaaaif commented Jan 19, 2023

I have tried with the sample code @Eilon provided and the issue still doesn't repro, the webview runtime version I am using is 109.0.1518.52. Could you please try with that version of WebView2 runtime to see if you still see the issue @applefanbois ?

haha, this was a good one... -.-
Hit ctrl and move the mouse for a few seconds. Breaks every webview2 in an WindowsAppSDK App >= v1.2, even with runtime 109.0.1518.52

@NeilQ
Copy link

NeilQ commented Jan 19, 2023

I have tried with the sample code @Eilon provided and the issue still doesn't repro, the webview runtime version I am using is 109.0.1518.52. Could you please try with that version of WebView2 runtime to see if you still see the issue @applefanbois ?

That caused by any quick text typing, so just copy some long text and paste(ctrl+v) to a text editor (like bing.com search box), paste, paste and paste, till the mouse frozen.

By the way it shows in any app which WindowsAppSDK >= v1.2 metioned above, v1.1.5 is fine. Not sure if caused by webview2 or WindowsAppSDK

@sebestyn168
Copy link

That caused by any quick text typing, so just copy some long text and paste(ctrl+v) to a text editor (like bing.com search box), paste, paste and paste, till the mouse frozen.

I pasted 10k words of Lorem Ipsum and it is not systematic, sometimes the app manages to hold for a while and you can edit the text and click on other components, sometimes it freezes for 5 seconds before responding but manages to recover and some times it crashes right after pasting. Then the app crashes every time it is restarted when pasting again. Waiting before restarting seems to help.

@KieranDevvs
Copy link

I have tried with the sample code @Eilon provided and the issue still doesn't repro, the webview runtime version I am using is 109.0.1518.52. Could you please try with that version of WebView2 runtime to see if you still see the issue @applefanbois ?

There are several issues linked to this from other repositories that have examples and reproduction steps.
Here is a video clearly showing the issue: https://www.youtube.com/watch?v=f5nYtta00y0

dotnet/maui#12361

@DanTwomey
Copy link

This is a critical issue and is effecting our blazor app in .net MAUI and means we cant release into production. This needs fixing asap.

@lapulpeta
Copy link

This issue appears in our app but I haven't found consistent steps to reproduce it. It's very annoying.

@Eilon
Copy link

Eilon commented Jan 23, 2023

@tofuandeve - I posted a standalone repro that uses only WinUI3 + WebView2, without any .NET MAUI: microsoft/WindowsAppSDK#3266 (comment)

Ping me on Teams/email internally if you'd like to chat more about this.

@koenvd
Copy link

koenvd commented Mar 8, 2023

Just to make everyone aware but a fixed is being tested it seems microsoft/WindowsAppSDK#3266 (comment) 🤞

@applefanbois
Copy link
Author

Good News

@DM-98
Copy link

DM-98 commented Mar 18, 2023

I had same issue in Blazor Hybrid MAUI (video demonstration) and when I removed OnAfterRenderAsync on my MainLayout, it started working smoothly again. Logic had StateHasChanged();, which I think was the issue.

@KieranDevvs
Copy link

I had same issue in Blazor Hybrid MAUI (video demonstration) and when I removed OnAfterRenderAsync, it started working smoothly again. Logic had StateHasChanged();, which I think was the issue.

That's my example video and the issue has nothing to do with Blazor thus "removing OnAfterRenderAsync" wouldn't do anything to prevent the problem. The cause has been fixed with a new version of WinAppSDK which will come to MAUI Blazor when the MAUI team upgrade the template version, or you can force it by manually specifying the NuGet package reference in the CSProj file.

@DM-98
Copy link

DM-98 commented Mar 18, 2023

I had same issue in Blazor Hybrid MAUI (video demonstration) and when I removed OnAfterRenderAsync, it started working smoothly again. Logic had StateHasChanged();, which I think was the issue.

That's my example video and the issue has nothing to do with Blazor thus "removing OnAfterRenderAsync" wouldn't do anything to prevent the problem. The cause has been fixed with a new version of WinAppSDK which will come to MAUI Blazor when the MAUI team upgrade the template version, or you can force it by manually specifying the NuGet package reference in the CSProj file.

I saw the video, it applied to me as well, which is why I referenced your video. The issue was in the Blazor which I used. And removing the OnAfterRenderAsync on my mainlayout did fix my issue I had for a while. That's only good if they've fixed it in the next release.

@applefanbois
Copy link
Author

The latest update is working fine for now.

Tell me, nobody noticed that the file drag & drop does not work in WebView2? It has never work, even when reported 2 years ago by many people. Another day, another basic feature not working.

1 problem fixed, now go fixe the remaining 100 000 broken and missing features in WebView2.

@c-npolyak
Copy link

I noticed the same problem with WinUI3.

@c-npolyak
Copy link

The latest update is working fine for now.

Tell me, nobody noticed that the file drag & drop does not work in WebView2? It has never work, even when reported 2 years ago by many people. Another day, another basic feature not working.

1 problem fixed, now go fixe the remaining 100 000 broken and missing features in WebView2.

@applefanbois which update is working for you? I thought I had a newest WinUI and it is still not working.

@c-npolyak
Copy link

@applefanbois I take it back. I did update everything to the latest and I could not reproduce the issue any more. So seems like it's been resolved.

@applefanbois
Copy link
Author

applefanbois commented Mar 23, 2023

How is it possible that the file drag and drop is not working in a modern web engine? Do I really need to report it? Am I the only one using it? Maybe MS should have used the Safari WKWebView engine instead? WebView2 is using the Chrome engine. Is the chrome engine so limited and unreliable out of the box? 2 years and it lacks all the basic features expected from a webview and most stuff that is there is not working correctly.

I remember the good old days of MFC and Win32, programmed in C. Those things were working great. Never had a problem with them. Sad that the new generation of MS programmers are not able to come close to their predecessors.

@c-npolyak
Copy link

How is it possible that the file drag and drop is not working in a modern web engine? Do I really need to report it? Am I the only one using it? Maybe MS should have used the Safari WKWebView engine instead? WebView2 is using the Chrome engine. Is the chrome engine so limited and unreliable out of the box? 2 years and it lacks all the basic features expected from a webview and most stuff that is there is not working correctly.

After MS killed Silverlight - a great product from my point of view, I am very cautious about MS UI packages. Though I still consider C# the best existing language for development (especially now after it became multiplatform and open source).

@applefanbois
Copy link
Author

There is ASM, C and all the other cheap programming languages that are basically C for dummies. C# is ok, but nothing more than a c++ that generate bytecode instead of Assembly.

@koenvd
Copy link

koenvd commented Mar 24, 2023

Can you close this issue as resolved now @applefanbois or @tofuandeve ?
Thanks!

@applefanbois
Copy link
Author

The problem is still there.

@Xyncgas
Copy link

Xyncgas commented Apr 6, 2023

The problem is still there.

If you create a new MAUI.Blazor project does this problem still exist

@danroth27
Copy link

If you create a new MAUI.Blazor project does this problem still exist

To get the fix in a .NET MAUI app, please upgrade the Microsoft.WindowsAppSDK dependency like this:

<ItemGroup>
    <PackageReference Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'" Include="Microsoft.WindowsAppSDK" Version="1.2.230313.1" />
</ItemGroup>

Note that you will need to do this manually by editing the project file instead of using the NuGet Package Manager UI.

@LccBuild
Copy link

To get the fix in a .NET MAUI app, please upgrade the Microsoft.WindowsAppSDK dependency like this:

<ItemGroup>
    <PackageReference Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'" Include="Microsoft.WindowsAppSDK" Version="1.2.230313.1" />
</ItemGroup>

Where does that go?
My MAUI Hybrid Blazor app project file does not seem to have an an entry containing "WindowsAppSDK"

@KieranDevvs
Copy link

KieranDevvs commented Apr 19, 2023

To get the fix in a .NET MAUI app, please upgrade the Microsoft.WindowsAppSDK dependency like this:

<ItemGroup>
    <PackageReference Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'" Include="Microsoft.WindowsAppSDK" Version="1.2.230313.1" />
</ItemGroup>

Where does that go? My MAUI Hybrid Blazor app project file does not seem to have an an entry containing "WindowsAppSDK"

That's because the reference is being imported as part of the MAUI framework. By specifying a package reference in your project file, the MAUI implicit reference will be overridden.

This is the reason why I raised a ticket, so that MAUI can upgrade the implicit reference rather than developers having to manually import a specific version.

dotnet/maui#14107

@LccBuild
Copy link

LccBuild commented Apr 20, 2023

That's because the reference is being imported as part of the MAUI framework. By specifying a package reference in your project file, the MAUI implicit reference will be overridden.

Thanks for clarifying.
Where do I find what WindowsAppSDK version MAUI currently uses?

[EDIT] Sorry, found it in packages ( is 1.2.221209.1 )

@Xyncgas
Copy link

Xyncgas commented May 16, 2023

is this included inside 1.3.230502000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests