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

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

Open
pvw-4bs opened this issue Jan 8, 2025 · 2 comments

Comments

@pvw-4bs
Copy link

pvw-4bs commented Jan 8, 2025

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

@dansiegel
Copy link
Member

This sure sounds like a Maui bug and not a Prism bug.

@pvw-4bs
Copy link
Author

pvw-4bs commented Jan 9, 2025

I'm no expert, but i've tested this in a pure MAUI project and the behaviour was correct.
repo: https://github.com/pvw-4bs/SoftInputChangingAfterNavigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants