dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.24k stars 1.76k forks source link

Blazor Hybrid - Android - Keyboard covers UI despite having resize soft keyboard setting #24573

Closed caliberdigitalllc closed 2 months ago

caliberdigitalllc commented 2 months ago

Description

I followed another thread or two talking about this issue, but I'm not sure they were specific to Blazor Hybrid.

I added:

using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;
using Application = Microsoft.Maui.Controls.Application;

namespace AbMobileMaui {
    public partial class App : Application {
        public App() {
            InitializeComponent();

            MainPage = new MainPage();

            Current.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);

        }
    }
}

but despite that, the keyboard overlays my UI instead of the UI sliding up or resizing.

Steps to Reproduce

This does not occur on iOS - iOS slides the whole app up to allow the keyboard and part of the UI to show up.

Link to public reproduction project repository

No response

Version with bug

9.0.0-preview.7.24407.4

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android

Did you find any workaround?

no

Relevant log output

No response

github-actions[bot] commented 2 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

caliberdigitalllc commented 2 months ago

before and after keyboard visible attached.

image image

caliberdigitalllc commented 2 months ago

One other update - I tried this on both my existing app (above) and a brand new 9p7 boilerplate blazor hybrid app where all I did was this in home.razor:

@page "/"

<h1>Hello, world!</h1>

<p>Welcome to your new app.</p>

<div class="container mt-4">
    @for (int i = 1; i <= 10; i++)
    {
        <div class="row mb-3">
            <div class="col">
                <input type="text" class="form-control" placeholder="Enter text here">
            </div>
        </div>
    }
</div>

and this in app.xaml.cs:

using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;
using Application = Microsoft.Maui.Controls.Application;

namespace MauiApp2 {
    public partial class App : Application {
        public App() {
            InitializeComponent();

            Current.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
        }

        protected override Window CreateWindow(IActivationState? activationState) {
            return new Window(new MainPage());
        }
    }
}

And if you tap in one of the last text boxes you can easily see the issue reproduce, even in a brand new barebones maui android app.

QianaJiao commented 2 months ago

There is a similar issue https://github.com/dotnet/maui/issues/18964 My result is a little different from yours.  If I add  Current.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize); UI will not be overlapped. Animation

Would you mind try it again? If you are still repro, could you share me the Android emulator API?

jfversluis commented 2 months ago

Duplicate of #18964

jfversluis commented 2 months ago

Please add your findings to the linked issue. That will make it easier to have all the information in one place and also that will surface the issue as potentially higher priority if more people interact with 1 issue instead of many describing the same thing.

caliberdigitalllc commented 2 months ago

Please add your findings to the linked issue. That will make it easier to have all the information in one place and also that will surface the issue as potentially higher priority if more people interact with 1 issue instead of many describing the same thing.

I copied my latest findings to that other thread.

caliberdigitalllc commented 2 months ago

There is a similar issue #18964 My result is a little different from yours.  If I add  Current.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize); UI will not be overlapped. Animation Animation

Would you mind try it again? If you are still repro, could you share me the Android emulator API?

I added the feedback in the other thread - that code didn't fix it for me on API level 35. Let's chat over there in the other thread though.