Skip to content

[BUG] SoftInputMode breaks when navigating. If first CreateWindow starts without "NavigationPage" #3298

@pvw-4bs

Description

@pvw-4bs

Description

I'm in the process of migrating an app from Xamarin to Maui. In the Xamarin app we did our first navigation without "NavigationPage/MainPage", we just did "MainPage". After migrating to MAUI, i noticed that when an Entry field got the focus the SoftInputMode would work as AdjustResize and not as AdjustPan. Also changing SoftInputMode didn't change anything.
After much investigation I found out that when we do our first navigation as "NavigationPage/MainPage" the issue wouldn't occur and AdjustPan was used.
I can work around this issue now by using the NavigationPage and hiding it with NavigationPage.HasNavigationBar="False"
So I've a work around, but still would like to inform you about the issue.
Repo to reproduce:
https://github.com/pvw-4bs/SoftInputNotChangingAfterNavigation

Prism.Maui 9.0.537

Steps to Reproduce

  1. Start the application
  2. Click SoftInputMode button
  3. You will see that colored borders change according to PanAdjust or PanResize behaviour
  4. Click Navigate
  5. Click on "Enter your name" so that keyboard pops up
  6. Click SoftInputMode button
  7. You'll observe that colored borders don't change anymore

If you change .CreateWindow("MainPage")); to .CreateWindow("NavigationPage/MainPage")); in MauiProgram.cs, the SoftInputMode keeps working after navigation

Platform with bug

.NET MAUI

Affected platforms

Android, I was not able test on other platforms

Did you find any workaround?

Add "NavigationPage/YourPage" to CreateWindow and hide navigationbar with NavigationPage.HasNavigationBar="False"

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions