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

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

Closed
caliberdigitalllc opened this issue Sep 2, 2024 · 8 comments
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/android 🤖 s/triaged Issue has been reviewed t/bug Something isn't working

Comments

@caliberdigitalllc
Copy link

caliberdigitalllc commented Sep 2, 2024

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

  • Created a new maui blazor hybrid app
  • Added UI elements
  • Ran on android
  • Tapped on input box, keyboard overlays the inputs and UI elements.

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

@caliberdigitalllc caliberdigitalllc added the t/bug Something isn't working label Sep 2, 2024
Copy link
Contributor

github-actions bot commented Sep 2, 2024

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
Copy link
Author

before and after keyboard visible attached.

image
image

@caliberdigitalllc
Copy link
Author

caliberdigitalllc commented Sep 2, 2024

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
Copy link

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

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

@QianaJiao QianaJiao added platform/android 🤖 s/triaged Issue has been reviewed labels Sep 3, 2024
@jfversluis
Copy link
Member

Duplicate of #18964

@jfversluis jfversluis marked this as a duplicate of #18964 Sep 3, 2024
@jfversluis jfversluis closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
@jfversluis
Copy link
Member

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.

@samhouts samhouts added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Sep 4, 2024
@caliberdigitalllc
Copy link
Author

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
Copy link
Author

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.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/android 🤖 s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants