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

Blazor UI Freezes entirely on .NET 7 #12262

Closed
nathanjeynes opened this issue Dec 22, 2022 · 12 comments
Closed

Blazor UI Freezes entirely on .NET 7 #12262

nathanjeynes opened this issue Dec 22, 2022 · 12 comments
Assignees
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView area-controls-webview WebView external p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/windows 🪟 s/needs-attention Issue has more information and needs another look t/bug Something isn't working

Comments

@nathanjeynes
Copy link

Description

I'm having an issue where the entire blazor UI freezes on Windows and does not accept any mouse clicks.

This specifically happens when holding a key on the keyboard for an excessive amount of time - and seems to happen regardless of the key. The time varies but usually happens after 10-15 seconds.

This has only happened since .NET 7 , and when targeting .NET 6 this is not a problem.

Unfortunately there are no console warnings or other logs that help point to the cause, but it is easy to replicate as below.

This is affecting all UI components from simple buttons to 3rd party components like the syncfusion datatable, and was picked up because a user was attempting to multi select rows in a data table by holding control key.

Steps to Reproduce

  1. Create a new .NET MAUI Blazor App (using the default project)
  2. Ensure the project is set to target .NET 7
  3. Run on windows
  4. Go to the counter page and hold CTRL (or any key) whilst clicking the increment counter button
  5. After 10-15 seconds the UI will freeze and you will no longer be able to interact with the app

Expected outcome:
The UI does not freeze and continues to respond as in .NET 6

Actual outcome
The UI freezes causing the user to have to force quit and re-launch the app

Link to public reproduction project repository

https://github.com/nathanjeynes/ExampleUIFreezeBug

Version with bug

7.0 (current)

Last version that worked well

6.0 Release Candidate 2 or older

Affected platforms

Windows

Affected platform versions

10.0.19041.0

Did you find any workaround?

No response

Relevant log output

No response

@nathanjeynes nathanjeynes added the t/bug Something isn't working label Dec 22, 2022
@Eilon Eilon added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Dec 22, 2022
@NetherGranite
Copy link

I have this happen when I horizontally scroll too fast/erratically (a degree a normal user would try to scroll).

A very simple repro is to make a Maui Blazor app from the template, make an element that can horizontally scroll, and then scroll left and right quickly and erratically by dragging the scrollbar back and forth or hold Shift and use the scroll wheel to scroll up and down.

You can consistently avoid the freeze by slowing scrolling using the arrows on the scrollbar. I don't know if speed is the cause, but it's the only correlation I can think of.

@javiercn
Copy link
Member

@nathanjeynes thanks for contacting us.

Does this happen on a regular webui without blazor?

@javiercn javiercn added the s/needs-info Issue needs more info from the author label Dec 23, 2022
@ghost
Copy link

ghost commented Dec 23, 2022

Hi @nathanjeynes. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@nathanjeynes
Copy link
Author

Hi @javiercn yes this seems to be a problem with the built in MAUI WebView also.
I added
<WebView Source="https://learn.microsoft.com/dotnet/maui" />
to a new maui content page and then held the ALT key for a while after launch - the UI then became completely unresponsive as in the blazor example.

Thanks

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Dec 24, 2022
@javiercn javiercn removed the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Dec 24, 2022
@Eilon Eilon added area-blazor Blazor Hybrid / Desktop, BlazorWebView area-controls-webview WebView and removed area-blazor Blazor Hybrid / Desktop, BlazorWebView labels Dec 27, 2022
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Dec 27, 2022
@rusfield
Copy link

rusfield commented Jan 2, 2023

I can confirm that the example repository is freezing the UI.
Thanks for narrowing down and reproducing the issue so easily, it has really been bugging me that my program is just "randomly" freezing without me having a clue whats going on. Now I guess it is from tabbing between inputs.

Hope someone can check it out and figure out whats going on; I'm really having a blast with MAUI and Blazor and would love to release my app using it :)

@KieranDevvs
Copy link

This should be a priority 1 bug as its stopping customers progressing on production, there just seems to be zero urgency.

@nathanjeynes
Copy link
Author

This should be a priority 1 bug as its stopping customers progressing on production, there just seems to be zero urgency.

Agree - we are unable to release our apps to customers as it happens so frequently, I hope this gets resolved soon.

@Eilon Eilon added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Jan 5, 2023
@JuanchiBruzzone
Copy link

JuanchiBruzzone commented Jan 18, 2023

Is there any solution/workaround/progress on this?

it's erratic but i could narrow it down to when the windows loses focus. it hangs.

@KieranDevvs
Copy link

KieranDevvs commented Jan 18, 2023

Is there any solution/workaround/progress on this?

it's erratic but i could narrow it down to when the windows loses focus. it hangs.

Only way to get around it is to downgrade the runtime to 6, but for some of us, that's not an option.

I wouldn't expect this to be looked at any time soon, Its already been an issue since November and not a single member from the WebView team has replied. Its genuinely mind boggling...

@JuanchiBruzzone
Copy link

Is there any solution/workaround/progress on this?
it's erratic but i could narrow it down to when the windows loses focus. it hangs.

Only way to get around it is to downgrade the runtime to 6, but for some of us, that's not an option.

I wouldn't expect this to be looked at any time soon, Its already been an issue since November and not a single member from the WebView team has replied. Its genuinely mind boggling...

That's unfortunate, thanks for your reply.

@danroth27
Copy link
Member

Hi @javiercn yes this seems to be a problem with the built in MAUI WebView also. I added <WebView Source="https://learn.microsoft.com/dotnet/maui" /> to a new maui content page and then held the ALT key for a while after launch - the UI then became completely unresponsive as in the blazor example.

Thanks

This appears to be an issue with WebView2. I'm able to reproduce with a WinUI3 app and WebView2. As reported the mouse stops working but keyboard inputs still seem to work.

This appears to a known WebView2 issue tracked by MicrosoftEdge/WebView2Feedback#3003. Please comment and upvote as appropriate.

@Eilon
Copy link
Member

Eilon commented Jan 23, 2023

Indeed, this is a duplicate of MicrosoftEdge/WebView2Feedback#3003.

@Eilon Eilon closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
@samhouts samhouts added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Jan 24, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Feb 23, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView area-controls-webview WebView external p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/windows 🪟 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants