-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
iOS iPad Entry Control: Tab on an external keyboard does not move between UI Elements #20135
Comments
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Looking into this one. Something I do notice is that when the hardware keyboard is connected to the iPad, the soft keyboard's tab button no longer changes the entry either. Edit - the behavior is that nothing happens when pressing tab with the software keyboard when the external keyboard is connected. |
It also seems that the |
In an xcode project, the tab key on an external keyboard on iPad with Full Keyboard Access turned off causes the next entry to be focused so this seems to be specific on Maui. |
Can also confirm that this works fine in Xamarin Forms with and without the Full Keyboard Access turned on. |
Okay, we were able to identify the issue! The problem seems to lie with the window.VisualDiagnosticsOverlay blocking the tab button with the hardware keyboard on iPad as shown in the method below. public static void MapContent(IWindowHandler handler, IWindow window)
{
_ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");
var nativeContent = window.Content.ToUIViewController(handler.MauiContext);
handler.PlatformView.RootViewController = nativeContent;
if (window.VisualDiagnosticsOverlay != null)
window.VisualDiagnosticsOverlay.Initialize();
} The workaround for this issue is to replace that mapper and remove those lines with the window.VisualDiagnosticsOverlay. You can add the code below to your MauiApp builder for example. .ConfigureMauiHandlers(_ =>
{
#if __IOS__
if(UIKit.UIDevice.CurrentDevice.UserInterfaceIdiom == UIKit.UIUserInterfaceIdiom.Pad)
{
WindowHandler.Mapper.ReplaceMapping<IWindow, WindowHandler>(nameof(IWindow.Content), (handler, window) => {
var _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");
var nativeContent = window.Content.ToUIViewController(handler.MauiContext);
handler.PlatformView.RootViewController = nativeContent;
});
}
#endif
}); |
Thank you for finding the cause and a workaround. |
@stevedcc The issue is because the WindowOverlay (used for handling overlay graphics on top of App Windows and diagnostics tooling, such has handling universal tap events) captured the tab event because the literal UIView layer being on top. Even though the user interaction events were being passed through (hence, clicks and taps worked fine) the view had to have its focus turned transparent to allow the tab event to work. My PR linked above should fix it. It seems like it only affected iOS though. Mac Catalyst worked fine. |
Thanks for the summary, Unfortunately, I have a customer who needed to replace a Xamarin app with a MAUI app and has had to live with this bug for 5 Months. I'm very grateful to you for finding and fixing this, and regret that the state of MAUI has meant that the consultancy I work for has decided to no longer offer green field MAUI projects, as a direct result of the extremely difficult migration from Xamarin to MAUI. Fundamentally the problems were:
Unfortunately we don't seem to be the only firm which has found MAUI to be less than satisfactory. As far as I can tell, a large number of developers with MAUI experience are choosing Swift and Kotlin for their future. |
@tj-devel709 This issue appears to still occur if you have entries within a scroll view even with the workaround in place. Is there a way to fix this as well? |
Description
When using an iPad, the tab key on the on-screen-keyboard will succesfully move between entry controls. Unfortunately, when using an external keyboard, the tab key does not work.
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
8.0.3
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 17
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: