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

Pressing TAB key on last focusable element crashes WebView2 inside Excel VSTO Task Pane #589

Closed
blair-halenda opened this issue Oct 30, 2020 · 15 comments
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@blair-halenda
Copy link

blair-halenda commented Oct 30, 2020

Description
Tabbing through elements in WebView2 (inside a VSTO task pane) works until the last web page element. Upon pressing TAB key again, the task pane freezes and Excel becomes unresponsive. This also occurs when pressing SHIFT + TAB on first web page element.

Initializing a Windows Form outside of the task pane (in the same application) performs as expected (with the last TAB returning to the top of the web page), so this must be an issue with parent COM objects.

My code already incorporates the proposed solutions from both #404 & #405.

No call-stack available. Excel freezes and Visual Studio debugger says "The application is in break mode". While debugging I was able to (by fluke) step into the WebView2 code and found a NullReferenceException, but I'm unable to reproduce.

Version
SDK: 1.0.674-prerelease
Runtime: Evergreen Distribution 86.0.622.58
Framework: Net Framework: 4.7.2, VSTO, WinForms (inside COM object)
OS: Win10

Repro Steps
Place WebView2 inside VSTO task pane. Press TAB on last element (or SHIFT + TAB on first element).

Expected: Web page focus returns to first focusable element in web page.
Actual: Application freezes/becomes unresponsive.

Excited about using WebView2 inside our VSTO addin and appreciate the hard work!

AB#30555786

@blair-halenda blair-halenda added the bug Something isn't working label Oct 30, 2020
@blair-halenda
Copy link
Author

Hi, wondering if there's any update on this issue? Is there any other information you require? Thanks!

@champnic
Copy link
Member

Sorry I missed this one - I've now added it to our backlog. I don't have a timeline on when we can investigate further - as a potential fix, can you try putting the WebView2 inside of another focusable control within the task pane? Thanks!

@blair-halenda
Copy link
Author

Thanks for the suggestion. I've tried nesting in different focusable controls and have done extensive experimenting with different settings to no avail. This is concerning because it crashes our software and there's no way for us to develop a workaround. We're looking to launch within the next few weeks. Is there any way that I could contribute to a fix?

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

Do you have a minimal sample app that reproduces the issue that I could try out?

@blair-halenda
Copy link
Author

I managed to get the exception to appear again, see below for the repo and exception screen capture. Feel free to reach out if you have any questions.
https://github.com/blair-halenda/WebView2Addin

@champnic
Copy link
Member

Thanks for the sample app! Was able to repro and know what the issue is - our WebView2 Winforms control is assuming it's on a Form and using FindForm() when trying to move focus to the next control. This should be relatively easy to fix on our end, but in the meantime I haven't been able to find a workaround.

@blair-halenda
Copy link
Author

blair-halenda commented Nov 20, 2020

Thank you for looking into this, that's great to hear! Do you have a time estimate for when I can expect a fix?

@champnic
Copy link
Member

Assuming we follow our regularly scheduled process, the fix will be in the next prerelease package, sometime in January.

@ShaunLoganOracle
Copy link

ShaunLoganOracle commented Feb 17, 2021

I still see the same (or a very similar) issue using WebView2 (Winforms) in an Excel VSTO Task Pane using SDK 1.0.705.50, RT Evergreen 88.0.705.68

@blair-halenda
Copy link
Author

@champnic do you have an updated ETA on this? There's been two new prereleases since this issue was posted and it still hasn't been resolved. Is there anything else I can do to help? Even a try catch on the control before calling .SelectNextControl() to prevent the crash would help significantly.

image

@champnic
Copy link
Member

@blair-halenda Sorry about the delay - we had some priority reshuffling. We are actively looking at this issue this sprint.

@johna-ms
Copy link
Contributor

@blair-halenda I'm investigating this and just wanted to update. This seemed like a straightforward fix at first, but I'm finding that I'm now running into a new issue where the crash no longer repros and I'm getting an infinite hang instead. This is called out in #933 which I'm also investigating. Sorry for the hold up!

@blair-halenda
Copy link
Author

Hi @johna-ms, I appreciate the update. The infinite hang is the error, and it's reproduceable (just checked with 1.0.824-prerelease). Before debugging, I had to uncheck Just My Code to see the exception. I've added a new section to my repo to show you how to set up your environment. Let me know if you're able to see the exception.

https://github.com/blair-halenda/WebView2Addin/blob/master/README.md#setting-up-debug-environment

@johna-ms
Copy link
Contributor

Ahhh I see. Unchecking Just My Code let's me see the exception. How odd for that to manifest as an infinite hang.. Thanks though!

@champnic
Copy link
Member

champnic commented May 4, 2021

This should be fixed in the latest prerelease SDK, 1.0.865-prerelease. Thanks!

@champnic champnic closed this as completed May 4, 2021
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

4 participants