Search code examples
c#blazormauimudblazormaui-blazor

How to add auto height increase when keyboard is active so content is not overlapped for Maui Blazor?


I am building a Maui Blazor application which has inputs/dialogs (using MudBlazor), but when there is an input at the bottom of the page it is overlapped by keyboard. It is the same for popups/dialogs if it has inputs.

Is there any way to create a general solution for this?

I have tried to add different position styles for inputs but rather search a general solution, I mean if content is covered by keyboard then height is increased

Thank you in advance!


Solution

  • For Android this solved the issue:

    public partial class App : Application
    {
        public App()
        {
            InitializeComponent();
    
            MainPage = new MainPage();
    
            Current.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
        }
    }