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

[Maui Blazor] Input overlapped by keyboard #18964

Open
JeanSebGwak opened this issue Nov 22, 2023 · 11 comments
Open

[Maui Blazor] Input overlapped by keyboard #18964

JeanSebGwak opened this issue Nov 22, 2023 · 11 comments
Labels
area-keyboard Keyboard, soft keyboard Blazor ❤️ MAUI Issues in MAUI functionality that affect Blazor, but are not bugs in Blazor itself platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@JeanSebGwak
Copy link

JeanSebGwak commented Nov 22, 2023

Description

When I tap an input (An InputText for example) near the bottom of the page, the virtual keyboard overlapping it.
Seems it's the same bug mentionned here : #14197
The answer written on August 11 says the issue was fixed, but it seems not.

As the steps to reproduce are really simple, I didn't find useful to provide a reproduction project.

My SDK version is 8.0.100, not 8.0.3 (Didn't have this choice in the dedicated dropdown).
I am on a physical device, Sony Xperia IV Android 13.

Edit : Maybe related to #18041

Steps to Reproduce

1 - Create a new MAUI Blazor project
2 - Add a bunch of InputText in the home page (Home.razor)
3 - Launch the app (I tried on a physical device)
4 - Tap an InputText near the bottom of the page to see the keyboard overlapping it

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 13

Did you find any workaround?

No response

Relevant log output

No response

@JeanSebGwak JeanSebGwak added the t/bug Something isn't working label Nov 22, 2023
@jsuarezruiz jsuarezruiz added area-blazor Blazor Hybrid / Desktop, BlazorWebView area-keyboard Keyboard, soft keyboard labels Nov 23, 2023
@williambuchanan2
Copy link

I am seeing the same thing. It is so frustrating that these keyboard issues are still happening in .NET 8. How can this not be top priority?

My main grips is what you reported - as soon as you go to the lower half of the screen you can't see anything because the keyboard covers it and the page doesn't scroll - end result is you can't see what you are typing.

It feels like someone just needs to dedicate some time to fix all these keyboard issues so that they can all be put to bed.

@samhouts samhouts added potential-regression This issue described a possible regression on a currently supported version., verification pending and removed potential-regression This issue described a possible regression on a currently supported version., verification pending labels Dec 6, 2023
@monster-echo
Copy link

Is there any workaround?

@williambuchanan2
Copy link

Is there any workaround?

Looks like they are working on it now:

#19214

The closest I came to a workaround was binding the height of the parent container to the height of the screen ( Grid HeightRequest={Binding TheHeight}), then when the keyboard shows I subtract 250 from that value.

Use the below to detect keyboard showing:

#if IOS

    var noti = UIKeyboard.Notifications.ObserveDidShow((sender, args) => {
        TheHeight= TheHeight- 250;
    });

#endif

Note that the first tap into the editor doesn't work, but subsequent taps do, so it's not a perfect workaround but the closest I have got after a week working on it!

@qualitycodes
Copy link

Found a workaround here -
#14197

@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 12, 2024
@Zhanglirong-Winnie
Copy link

Zhanglirong-Winnie commented Apr 12, 2024

Verified this issue with Visual Studio 17.10.0 Preview 3(8.0.3 &8.0.7&8.0.20). Can repro on android platform.

@mkArtakMSFT
Copy link
Member

This doesn't seem to be Blazor related and may very well be the dupe of the linked issue.

@mkArtakMSFT mkArtakMSFT removed the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Apr 19, 2024
@Eilon Eilon added the Blazor ❤️ MAUI Issues in MAUI functionality that affect Blazor, but are not bugs in Blazor itself label Apr 19, 2024
@michaelprabhuu
Copy link

      using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;

      namespace AI_Chat_Bot_Hybrid
      {
          public partial class App : Microsoft.Maui.Controls.Application
          {
              public App()
              {
                  InitializeComponent();

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

The above code works well if you add in the App.xaml.cs file

@lommez
Copy link

lommez commented Sep 7, 2024

@JeanSebGwak take a look that this:

#14197

@caliberdigitalllc
Copy link

Reporting here from my other created issue (that was referred to this issue), On 9 preview 7, on a Pixel 7 API 35 simulator, the issue still persists.

image

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.

@lommez
Copy link

lommez commented Oct 1, 2024

Anyone have success to implement that behavior in a .Net Maui Hybrid application?
I´ve tried a lot, but none have worked.

@lommez
Copy link

lommez commented Oct 11, 2024

This is a very old issue, any updates on this?
In .Net 9.0 this is going to be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-keyboard Keyboard, soft keyboard Blazor ❤️ MAUI Issues in MAUI functionality that affect Blazor, but are not bugs in Blazor itself platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests