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

[Problem/Bug]: WebView2CompositionControl Not Displayed Correctly with Multiple TabItems #4941

Closed
cmiles opened this issue Nov 20, 2024 · 6 comments
Assignees
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@cmiles
Copy link

cmiles commented Nov 20, 2024

What happened?

The WebView2CompositionControl works as expected when in the first TabItem of a WPF TabControl but in other tabs it does not display anything.

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Prerelease (Edge Canary/Dev/Beta)

Runtime Version

130.0.2849.80

SDK Version

2950.0

Framework

WPF

Operating System

Windows 11

OS Version

10.0.22631 Build 22631

Repro steps

I have attached a small solution that shows that problem - the WebView2CompositionControl in the first tab works without issue - the WebView2CompositionControls in the 2nd and 3rd tab fail to display anything. Here are some things I noticed:

  • Events/Code for the WebView2CompositionControls in the 2nd and 3rd tab continue to work - in a more complicated application all events seemed to fire, but nothing was displayed
  • There is no exception thrown
  • In this application if you swap all of the WebView2CompositionControls for WebView2 controls the app works as expected

I've been following #286 but haven't noticed any problems/work arounds/limitations mentioned that indicate in WPF this scenario should work with WebView2 but not WebView2CompositionControl.

WebView2CompositionControlInTabs.zip

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

AB#55205081

@cmiles cmiles added the bug Something isn't working label Nov 20, 2024
@bradp0721 bradp0721 assigned champnic and unassigned bradp0721 Nov 22, 2024
@champnic
Copy link
Member

@cmiles Thanks for opening this bug and for the repro app. I'm able to repro the issue on my end and will begin investigating.

@champnic champnic added the tracked We are tracking this work internally. label Nov 22, 2024
@champnic
Copy link
Member

@cmiles Found the root cause and I've got a fix getting checked in shortly.

@cmiles
Copy link
Author

cmiles commented Nov 28, 2024

Thanks @champnic - before finding this bug swapping WebView2 for the WebView2CompositionControl was going smoothly and I'm looking forward to your fix getting into preview!

@champnic
Copy link
Member

champnic commented Dec 2, 2024

@cmiles Glad to hear it! The fix is in and will be available in the next prerelease SDK. If you would like to, you can use this package to verify the fixed behavior (rename ".zip" to ".nupkg"):
Microsoft.Web.WebView2.1.0.2980.zip

@champnic champnic closed this as completed Dec 2, 2024
cmiles added a commit to cmiles/PointlessWaymarksTools that referenced this issue Dec 4, 2024
cmiles added a commit to cmiles/PointlessWaymarksProject that referenced this issue Dec 4, 2024
@cmiles
Copy link
Author

cmiles commented Dec 4, 2024

@champnic I used the package you attached to update the code in https://github.com/cmiles/PointlessWaymarksProject and can confirm this issue is fixed - Thank You. My project makes reasonably simple use of the WebView2 but fwiw I was able to convert all my usages of WebView2 to WebView2CompositionControl so far without any issues!

@champnic
Copy link
Member

champnic commented Dec 4, 2024

@cmiles That's really great news, and thanks for confirming the fix! Please do reach out if you end up finding any more issues with the new control :)

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

3 participants