MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
452 stars 55 forks source link

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

Closed applefanbois closed 1 year ago

applefanbois commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Hitting the same issue. Any updates?

applefanbois commented 1 year ago

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 commented 1 year ago

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: https://github.com/microsoft/WindowsAppSDK/issues/3266

applefanbois commented 1 year ago

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

applefanbois commented 1 year ago

The problem is still there in Microsoft.WindowsAppSDK 1.2.221209.1

Eilon commented 1 year ago

Please refer to https://github.com/microsoft/WindowsAppSDK/issues/3266#issuecomment-1372636220 for a trivial WinUI3 + WebView2 repro.

nathanjeynes commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

sebestyn168 commented 1 year ago

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 commented 1 year ago

same issue and upvote...

applefanbois commented 1 year ago

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 commented 1 year ago

I'm having the same issue. Any updates?

applefanbois commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

tofuandeve commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

https://github.com/dotnet/maui/issues/12361

DanTwomey commented 1 year ago

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 commented 1 year ago

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

Eilon commented 1 year ago

@tofuandeve - I posted a standalone repro that uses only WinUI3 + WebView2, without any .NET MAUI: https://github.com/microsoft/WindowsAppSDK/issues/3266#issuecomment-1372636220

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

hartez commented 1 year ago

I also run into this if I'm running the WinUI app on a VM via Remote Desktop and I switch to another VM. When I switch back, the mouse often (not always, but most of the time) stops working. Keyboard is still functional.

pabloordonez commented 1 year ago

We can reproduce this too within a WinUI 3 application (Windows App SDK 1.2.221209.1). The two ways to reproduce, as mentioned here, is to write too much too fast, or to focus and blur the window. When navigating to other windows and getting back, sometimes the mouse stop responding. Also as mentioned, even if the mouse is blocked, keyboard continues to work, and you can navigate and operate the page normally. There's drop in performance, just the mouse getting disabled. There is no change in memory consumption, nor CPU usage. Is also worth mentioning that normally, after some time the mouse is unblocked. I wasn't able to detect the source condition for the blockage, or to unblock it yet.

Update: It seems that navigating with tabs and shift-tab will unblock after a couple of tries. We reviewed the WebView task manager window while testing and we didn't see anything unusual. It happens both in debug and release deployments.

tofuandeve commented 1 year ago

Okay I got it to repro with @Eilon 's help! We have opened a bug for this with hi pri, and will start looking into fixing this.

Thank you all for all the helpful info to get the repro.

pabloordonez commented 1 year ago

Excellent news @tofuandeve !! Please let us know if you need something else! (And thank you!)

KieranDevvs commented 1 year ago

@tofuandeve Can we get updates seeing as the bug tracking isn't publicly accessible? Is there an ETA on this?

tofuandeve commented 1 year ago

Hi @KieranDevvs we are actively working on this issue with WinUI team right now as this issue is marked as highest priority of this sprint for us. We'll keep you posted on the progress, thank you for your patience.

Thank you!

koenvd commented 1 year ago

We can also easily reproduce this when moving from a Parallels VM running the app to another screen outside the Parallels VM and then moving back to the app.

The app is built with WindowsAppSdk 1.2.221109.1, Webview2 Runtime 109.0.1518.70, running on Windows 11. The issue does NOT reproduce when using WindowsAppSdk 1.1.4. Both versions are targeting net6.0-windows10.0.19041.0.

So pretty consistent with what has been shared here already but maybe it can still help 😀.

tofuandeve commented 1 year ago

Hi all, we are working with WinUI team and it seems like this might be a regression from WindowAppsSDK, we passed the issue to the owner team and they will take a look at this asap. Will keep you posted on the progress!

Thanks!

ghost commented 1 year ago

I add a simple EditForm on Index.razor. As soon as I press the keyboard keys a little fast, the mouse is completely disabled.

@using System.ComponentModel.DataAnnotations
@page "/"

<h1>Hello, world!</h1>

Welcome to your new app.

<EditForm Model="instance" OnSubmit="OnRegister">
    <DataAnnotationsValidator />
    <InputText @bind-Value="instance.CompanyName" />
    <InputText @bind-Value="instance.InstanceName" />
    <InputText @bind-Value="instance.ServerName" />
    <InputNumber @bind-Value="instance.Port" />
</EditForm>

<SurveyPrompt Title="How is Blazor working for you?" />

@code {
    protected Instance instance = new();

    protected override void OnInitialized()
    {

    }

    protected async Task OnRegister(EditContext form)
    {
        form.Validate();
        await Task.CompletedTask;
    }

    public class Instance
    {
        [Required]
        public string CompanyName { get; set; } = "";

        [Required]
        public string InstanceName { get; set; } = "";

        [Required]
        public string ServerName { get; set; } = "";

        [Range(1000, 9000)]
        public int Port { get; set; }
    }
}
KieranDevvs commented 1 year ago

Hi all, we are working with WinUI team and it seems like this might be a regression from WindowAppsSDK, we passed the issue to the owner team and they will take a look at this asap. Will keep you posted on the progress!

Thanks!

Has an issue been opened within https://github.com/microsoft/WindowsAppSDK?

nathanjeynes commented 1 year ago

@tofuandeve Hi, could you provide an update as this has not received any updates for 2 weeks.
Thanks

Xyncgas commented 1 year ago

Yea.. I wasn't crazy I was just trying to type and click and mess with my computer, I am a random person on a random machine but I found a way to 100% produce this issue which is basically what we are all saying here

As a programmer, I am infinitely interested on what happened here, spill the beans I won't blame you

Was it a memory leak, was it a dangling pointer, was it a null that's gone un-noticed or the wrong reference is being called due to Atomic operation became not atomic

Xyncgas commented 1 year ago

WPF / UWP / MAUI / Xamarin / WinForm / WinUI

Just stop XAML (hardcoding UI is not very smart), don't bother shipping a bunch control, how about a cross platform GUI platform (like a browser) that doesn't use plaintext html or javascript engine that exposes its api for us to use directly in any language to compile the GUI solution with our functions calling its api, or indrectly by spinnin up exisitng GUI solution and talking to that process in binary, meanwhile as long as you let me put pixels on the screen control what each pixel looks like, provide abstractions like ok I am going to put a rectangle instead of just one pixel, let me say how many pixels the font size is or what's the color of this element, then finally what is user doing it them (clicked, rightclicked, mouse moved etc more features here) then I will feel enough

Users on the other hand, check this out : https://github.com/ddobrev/QtSharp, oh this's wonderful

Microsoft texts too many of their products in production. Such as WindowsPhone, such as bing right now with this AI thing.

Maybe, purchase qt instead of developing yet another XAML GUI project because they are all the same and they are not working

gdar91 commented 1 year ago

This is a major blocker.

KieranDevvs commented 1 year ago

This is a major blocker.

Clearly not major enough, judging by the way this is being dealt with.

applefanbois commented 1 year ago

WebView2 does not work since 9 months. Just creating a webview and loading the google page and type a few letter is enough to crash the app and MS does not care. There are no working web solution on windows right now.

MS has abandoned windows 25 years ago. Their solution is that Windows11 support natively Android app and they recommend using the Amazon android App Store. We should go make an android app and it will run better in windows than native app.

MS Store is the only store that does not install dependencies (from their own libraries)

tofuandeve commented 1 year ago

Has an issue been opened within https://github.com/microsoft/WindowsAppSDK? @KieranDevvs Yes this issue is reported here https://github.com/microsoft/WindowsAppSDK/issues/3266

tofuandeve commented 1 year ago

As of today, WinUI team is actively working on investigating this issue. I will let you know as soon as we get more updates from them. Thank you for your patience.

Thanks!

applefanbois commented 1 year ago

The fact that there are many ways to make an app for windows is the source of all the problems. There is only 1 way to make an app on macOS and iOS, there is only 1 language and there is only 1 sdk. Android is the same, only 1 framework/sdk and only 1 language.

There are 20 official way to make app for windows (15 of them are already deprecated and abandoned). This is too much and it will never work.

KieranDevvs commented 1 year ago

I am sometimes very angry at Microsoft myself, even though I earn my money professionally thanks to Microsoft programming. But then I always remind myself that the people who develop Microsoft products feel the same way I do when I unknowingly introduce a bug somewhere in my software. So we should remain proper compared to our colleagues (from Microsoft), because what these different Microsoft teams bring together mostly exceeds everything that every programmer of us has done in his life! at this point a big respect to all who develop Microsoft products together.

I want to get rid of something else. If you restrict yourself to Windows only (e.g. winForms or WPF), then you have no problems. I have developed a lot of Windows applications in the last 20 years and never had any problems with libraries, frameworks or the like. But it's a different story if you want to develop for other platforms, and I think that all this anger towards Microsoft comes from the fact that Microsoft still can't manage to provide a framework that you can program with fully support to other platforms. That actually comes from the fact that Microsoft has always tried to rely on their own solutions. But this has changed a lot in the last years, especially with Blazor. Unfortunately it takes a lot of time until all Microsoft ideas have matured (e.g. MAUI Blazor). My personal opinion is that especially MAUI Blazor could be the ultimate development platform. But I was so desperate and disappointed because of so many bugs, that I decided to switch to Flutter last year, so that I can develop programs with one code base for all systems. After about 2 months of intensive training and 2 implemented projects I went back to MAU Blazor. I don't want to go into the reasons here, that would take too long.

But my conclusion is that we have to be patient, because the way Microsoft is going, Google did it with Flutter and others too. Once MAUI Blazor is stable, we will benefit a lot from it and we will be able to develop apps for all platforms (Windows, Web, Android or iOS). Don't be surprised about the web listing, officially MAUI only supports native app development, but if you set up a Visual Studio project cleverly using Blazor, then web is also possible with the same code.

I'm very happy with Blazor (and now MAUI), but I'm annoyed by all the bugs and I can only hope that we'll get a stable MAUI (Blazor) at least this year.

Big thanks to Microsoft Teams

I'm sorry but no. You don't get to pull the "we're human, we make mistakes" card. Making a mistake would be: the bug occurring, being filed as a P1 issue, a staff member promptly picking the issue up, and delivering a fix within a reasonable time frame in accordance with how complicated the issue is. And if the issue is complicated thus will take some time to resolve / is being blocked by something else, then clear and frequent updates would be given to users so they can make informed actions as to how they want to deal with their own projects.

What actually happened was several people raised the same bug in different posts in November last year after the release of .NET 7, and the issue wasn't even looked at until several months after the initial post. And that was only because other teams got an influx of problems relating to this dependency, and no one was doing anything about it. Even to this day, the problem isn't fixed, there's no ETA on a resolution, and its been passed off to another team whos tracking it internally, and isn't giving updates to any of its users yet again.

oliverw commented 1 year ago

There are 20 official way to make app for windows (15 of them are already deprecated and abandoned). This is too much and it will never work.

It's not like someone forced Microsoft to go that route. This is entirely on them. The really, really baffling and concerning part is that high profile issues - such as this one - do not appear to be of particular importance internally. I guess that's what you get when you are not dogfooding your own stuff like Apple and Google do. Not that I prefer their technologies over .NET, but at least they stick to their guns and I bet that if someone breaks something in UIKit at Apple, other internal teams will take notice because they actually use that stuff.

ghost commented 1 year ago

@tofuandeve We are nearing completion of our product and are completely bogged down by this issue. Please provide an ETA or workaround/patch for this issue. We are in a desperate situation.

applefanbois commented 1 year ago

I am gonna be real here. MS failed to give us a proper WebView for 10 years, so you can probably wait another 5 years. And when that thing is stable, they will cancel it like they did with UWP and HoloLens.

It would be wiser to start over again with QT, GTK or Electron.

Another better solution would be to make an Android App and put it on the Android Amazon Store because it would run natively on Windows 11. Sadly, Windows Server are not compatible with Windows (Windows Server has no MS Store, NO Amazon Android App Store and does not support native android app). MS Windows died 20 years ago and you just refuse to acknowledge reality. Don't hurt yourself, it is time to move on.

alelom commented 1 year ago

@tofuandeve We are nearing completion of our product and are completely bogged down by this issue. Please provide an ETA or workaround/patch for this issue. We are in a desperate situation.

Just reporting that I am in the exact same situation. This bug costed us hours of research to find a workaround which cannot be done. It is a major dealbreaker for our UI developed in MAUI Hybrid.