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

TAB/SHIFT-TAB navigation issue #933

Closed
mikeduglas opened this issue Feb 12, 2021 · 11 comments
Closed

TAB/SHIFT-TAB navigation issue #933

mikeduglas opened this issue Feb 12, 2021 · 11 comments
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@mikeduglas
Copy link

mikeduglas commented Feb 12, 2021

Description
When a keyboard focus is on first focusable element on web page and a user presses Shift-Tab, or
a keyboard focus is on last focusable element on web page and a user presses Tab, then WV2 control and entire program stops responding to any user interaction (keyboard, mouse), and the program must be killed thru Task manager.

Version
SDK: 1.0.705.50
Runtime: 88.0.705.63
Framework: WinForms, Win32
OS: Win10

Additional context
I'm using non standard environment: I have a WinForms dll that exports UserControl with WebView2 control. This control is embedded into Win32 window (using SetParent api). So far so good except this issue with TAB navigation.
.

AB#31757154

@mikeduglas mikeduglas added the bug Something isn't working label Feb 12, 2021
@ShaunLoganOracle
Copy link

ShaunLoganOracle commented Feb 16, 2021

I see a similar issue using shift+Tab then shift+F6 when I host a WebView2 control in an Excel Task Pane. In my case, Excel goes into "Not Responding" and uses 25% or so of my CPU. The webview2 processes are idle. I am using the same SDK and RT as @mikeduglas

@ShaunLoganOracle
Copy link

Possibly related to #589 ?

@champnic
Copy link
Member

Yes these issues might be related. I think we probably have a bug around expecting the parent of the WebView2 control to be a Form or something, and are running into these issues when the parent is different - Win32 HWND and/or TaskPane. I've opened a bug on our backlog to track this and will link it to the #589 bug as well. Thanks!

@champnic champnic added the tracked We are tracking this work internally. label Feb 17, 2021
@mikeduglas
Copy link
Author

mikeduglas commented Feb 24, 2021

Would be great to have FocusMoving event with a flag indicating "by tab key or by mouse" it is moving", source control, target control, and boolean "handled (or "cancel)" allowing to cancel the operation.

@mikeduglas
Copy link
Author

Just tested new v1.0.774.44, unfortunately nothing has been changed and WebView2 is still unusable for us.

@mikeduglas
Copy link
Author

With new updates the issue seems to gone away:

SDK: 1.0.865-prerelease
Runtime: 92.0.873.1 Dev

I will test more and close the issue if everything goes well.

@champnic
Copy link
Member

champnic commented May 4, 2021

Yup this issue should be fixed in 1.0.865-prerelease SDK package. I'm going to close this issue now, but please let me know if you run into any issues around this. Thanks!

@champnic champnic closed this as completed May 4, 2021
alaincao pushed a commit to alaincao/ExcelDNASamples that referenced this issue May 5, 2021
alaincao pushed a commit to alaincao/ExcelDNASamples that referenced this issue May 5, 2021
@alaincao
Copy link

alaincao commented May 5, 2021

Hi,

I am not sure if it is an issue with ExcelDNA or with WebView, but I still have an issue with the keyboard focus when used with ExcelDNA Custom Task Panes:
When I click the WebView window so it get the focus and seems to keep it and the worksheet loses the controls with keyboard arrows/page up|down.
Everything returns to normal after clicking on another window and going back to the worksheet.

@champnic
Copy link
Member

champnic commented May 6, 2021

Hey @alaincao - this sounds like a separate issue. Are you using Tab/Shift-Tab to move keyboard focus out of the WebView2? While focus is on the WebView2 it's expected that it will key the arrow up/down input until focus leaves the WebView2 control.

@alaincao
Copy link

alaincao commented May 6, 2021

I tried to use the tab key to move the focus out of the WebView control, but the focus cycles through the controls inside the HTML and never goes out ; I guess this is expected behaviour.
But clicking on a control/the worksheet outside the WebView does not release the focus from the WebView. The keyboard is still interacting with the WebView even if another cell in the worksheet is selected.

Sorry, I was not too sure what to do with that issue so I put it here since it looked like related to focus. Should I create a separate issue?

@champnic
Copy link
Member

champnic commented May 6, 2021

@alaincao That sounds like #951. Can you take a look and see if you agree? Feel free to add extra info there if so.

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