MicrosoftEdge / WebView2Feedback

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

Mouse events not captured by WebView2 if Canvas present on top of it #3181

Open Take-A-Byte opened 1 year ago

Take-A-Byte commented 1 year ago

Description WebView2 behavior differs from WebView behavior when InkCanvas is placed on top of it

Version SDK:1.0.1518.46 Framework: UWP OS: Win11

Repro Steps

  1. Create a UWP app
  2. Add a Grid
  3. Add WebView2 control with source a long website (e.g. - https://learn.microsoft.com/en-in/)
  4. Add InkCanvas control below WebView2 (in view-tree, it will be rendered over WebView2)
  5. Run app and try to scroll

Expected behavior - Page scrolls Actual behavior - Page does not scroll

Additional Context Same app, if used with WebView allows mouse interaction even when InkCanvas is placed above WebView

Is there an alternative using which we could use InkCanvas over WebView2 until the bug is fixed?

AB#43256205

champnic commented 1 year ago

Hey @Take-A-Byte - Can you share a sample app with your setup that reproduces this issue? Is the InkCanvas completely covering the WebView2, or only part of it but you can't scroll the other part? Are you able to scroll if focus is moved to the WebView2?

Take-A-Byte commented 1 year ago

WebViewAnd2InOne.zip Hey @champnic - Here is a sample app. A bit about the app: Initially, it has a WebView rendered while WebView2 is collapsed After you press the button at the bottom, It will render WebView2 and collapse WebView, In both cases i.e. WebView and WebView2, Canvas is rendered on top and completely covers WebViews.

Also, setting a programmatic focus also did not help me to scroll...

Take-A-Byte commented 1 year ago

https://user-images.githubusercontent.com/29909785/217016123-ab4ba033-9398-41b9-b12b-464be1920012.mp4

Here is a sample video of the app.

champnic commented 1 year ago

Thanks for the info. I've added this as a bug on our backlog. I believe this will have to be investigated/fixed by the WinUI team.