maui icon indicating copy to clipboard operation
maui copied to clipboard

MAUI Blazor Hybrid macOS does not react to [Tab] [Up] [Enter] keys etc.

Open LccBuild opened this issue 2 years ago • 4 comments
trafficstars

Description

It is not possible to tab navigate between html element on a page in BlazorWebView, on macOS ( MacCatalyst) . It works fine under Windows and for regular Blazor apps on macOS.

Steps to Reproduce

  1. Create a new MAUI Blazor Hybrid app, with the standard template.
  2. Add a couple of <input> elements to the index page
  3. Run and place cursor in first <input> element and press [Tab] on your keyboard
  4. Focus does not change to next <input> element.

Other elements like dropdowns, does not recieve [up][down] [enter] etc.

Link to public reproduction project repository

https://github.com/LccBuild/MauiNoTabsOnmacOS

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

13

Did you find any workaround?

No

Relevant log output

No response

LccBuild avatar Dec 21 '22 11:12 LccBuild

@LccBuild can you try this scenario with a default WebView control (not Blazor Hybrid) and see if the issue still persists or not? Thanks!

mkArtakMSFT avatar Dec 22 '22 17:12 mkArtakMSFT

Hi @LccBuild. 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 Dec 22 '22 17:12 ghost

@LccBuild can you try this scenario with a default WebView control (not Blazor Hybrid) and see if the issue still persists or not? Thanks!

I have created a non MAUI project that uses a WKWebView control, and it seems it has the same issue:


using WebKit;
namespace TestKeys;

[Register ("AppDelegate")]
public class AppDelegate : UIApplicationDelegate {
	public override UIWindow? Window {
		get;
		set;
	}

	public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
	{
		// create a new window instance based on the screen size
		Window = new UIWindow (UIScreen.MainScreen.Bounds);

		// create a UIViewController with a single UILabel
		var vc = new UIViewController ();
	 
		Window.RootViewController = vc;
		 
		WKWebView webView = new WKWebView(vc.View.Frame,new WKWebViewConfiguration());
        vc.View.AddSubview(webView);

        var url = new NSUrl("https://google.com");
        var request = new NSUrlRequest(url);
        webView.LoadRequest(request);

        // make the window visible
        Window.MakeKeyAndVisible ();

		return true;
	}
}





LccBuild avatar Dec 22 '22 21:12 LccBuild

@mkArtakMSFT Any news on this? It is a very serious issue, that stops keyboard navigation in all Blazor Hybrid apps.

LccBuild avatar Mar 10 '23 07:03 LccBuild

Cross-linking to https://github.com/dotnet/maui/issues/13934

Eilon avatar Mar 22 '23 18:03 Eilon

Seems to be a very broad issue that is not .NET specific at all. It might be an issue with the actual WKWebView control on MacCatalyst: https://developer.apple.com/forums/thread/721141

Eilon avatar Mar 22 '23 18:03 Eilon

Closing as dupe of https://github.com/dotnet/maui/issues/13934 because it's the same fundamental issue: the native WebView used in Mac Catalyst has an issue with keyboard presses. See the other issue for more details.

Eilon avatar Mar 22 '23 23:03 Eilon

To anyone seeing this issue: On whichever Mac you are seeing this issue, can you tell us what type of Apple hardware you have?

To find this info:

  • On your Mac, click on the Apple logo at the upper-left corner of the screen, then select About This Mac
  • It will say "Processor" or "Chip" and next to that it will say either Intel (such as Intel Core i7) or Apple (such as Apple M1)

Eilon avatar Mar 23 '23 22:03 Eilon

To anyone seeing this issue: On whichever Mac you are seeing this issue, can you tell us what type of Apple hardware you have?

Hi @Eilon I experience this on a MacBook Pro M1 Max

LccBuild avatar Mar 24 '23 07:03 LccBuild

@Eilon I'm having this issue on a 16" Macbook Pro M1. Tab works fine on Windows but doesn't do a thing on mac.

tstephansen avatar Apr 05 '23 23:04 tstephansen