maui icon indicating copy to clipboard operation
maui copied to clipboard

Backwards tab navigation cannot move focus away from a Windows Forms BlazorWebView

Open MackinnonBuck opened this issue 3 years ago • 5 comments

Description

When using backwards tab navigation (shift+tab) on the children of a BlazorWebView, focus cannot escape the WebView. When the first child of the WebView is focused, shift+tabbing results in the last child of the WebView receiving focus rather than the native control whose tab index precedes that of the BlazorWebView.

This does not reproduce on the Windows Forms WebView2 control, so it does appear to be specific to Blazor Hybrid.

Steps to Reproduce

  1. Create a File > New Windows Forms App
  2. Follow the steps here to turn the project into a Windows Forms Blazor app
  3. Add two Button controls to Form1, where the tab order goes "button1 > blazorWebView1 > button2"
  4. Run the app
  5. Click on button1 so it receives focus.
  6. Press "tab"
  7. The focus should now be on the "Click me" button in the WebView
  8. Press "shift+tab", and note that the focus still remains on the "Click me" button
  9. Press "tab" and note that the focus escapes the WebView to button2

Version with bug

6.0.400 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Tested on Windows 11 Enterprise, Version 21H2

Did you find any workaround?

I did not find a workaround.

Relevant log output

No response

MackinnonBuck avatar Jun 23 '22 23:06 MackinnonBuck

@MackinnonBuck can you share the repro project please?

kristinx0211 avatar Jun 24 '22 08:06 kristinx0211

Hi @MackinnonBuck. 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.

ghost avatar Jun 24 '22 08:06 ghost

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

ghost avatar Jun 28 '22 09:06 ghost

I've added a repro project here: https://github.com/MackinnonBuck/BlazorWebViewWinFormsTabNavigationBug

MackinnonBuck avatar Jun 28 '22 17:06 MackinnonBuck

confirm same as above description. when the click me button is focused, shift+tab results in Dummy2 focus, not button1. https://user-images.githubusercontent.com/99457000/176342990-a122d6b0-7a7a-4122-a892-827f72db219a.mp4

kristinx0211 avatar Jun 29 '22 03:06 kristinx0211

I was able to reproduce this issue when wrapping a WebView2 control in an otherwise empty ContainerControl and reproduce the same issue, so I've opened https://github.com/MicrosoftEdge/WebView2Feedback/issues/2835 to track this getting resolved.

MackinnonBuck avatar Sep 29 '22 21:09 MackinnonBuck

Closing since this is a bug with the WebView2 Windows Forms control and we have a separate issue tracking that.

MackinnonBuck avatar Oct 06 '22 18:10 MackinnonBuck