maui
maui copied to clipboard
Entry hides while keyboard popup on Android.
Description
I place an entry in the ContentView on the below right side, and while I focus keyboard will pop up and hide the entry.
https://github.com/dotnet/maui/assets/102668599/c4bae730-b119-4eaf-bdd4-b83da3a2e773
Steps to Reproduce
- Run the attached sample
- Click the button "Show NavigationView on the right side" button.
- Focus the entry on the below right side.
- Actual Result: The keyboard hides the entry.
- Expected Result: To show the entry above the keyboard.
Link to public reproduction project repository
https://github.com/Arunachalam3641/EntryIssueAndroid
Version with bug
8.0.3
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 13
Did you find any workaround?
No response
Relevant log output
No response
@Arunachalam3641 if you simplify the layouts here does that fix?
https://github.com/Arunachalam3641/EntryIssueAndroid/blob/main/NavigationViewDemo/NavigationViewDemo/MainPage.xaml#L7-L10
Like just use a ListView at the root?
Hi @Arunachalam3641. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Hi @PureWeen,
I tried without the ScrollView layout; the same issue output is replicated. We are required to show the all elements inside the scroll view. Please provide the solution based on the requirement.
Verified this on Visual Studio Enterprise 17.9.0 Preview 5(8.0.3). Repro on Android 14.0-API34, not repro on iOS 17.2 with below Project: NavigationViewDemo.zip
@Arunachalam3641 if you toggle this property does it work?
https://learn.microsoft.com/en-us/dotnet/maui/android/platform-specifics/soft-keyboard-input-mode?view=net-maui-8.0
@Arunachalam3641 if you toggle this property does it work?
https://learn.microsoft.com/en-us/dotnet/maui/android/platform-specifics/soft-keyboard-input-mode?view=net-maui-8.0
Not making a difference.
@Arunachalam3641 @PureWeen
I have resolved the problem for my project (on Android), the issue is different but i think might be related.
I was using translationY to hide and show a menu that comes up from the bottom. the translationY = 0 position of my menu needs to be within the screen area for the keyboard-obscuring-entry-prevention mechanism to work. If The translationY = 0 position of the menu is set to be below the screen area (done using AbsoluteLayout), then this mechanism won't work.
In your case I see that the translationX = 0 position is already in the screen area, I think the issue is more related to using a ListView. Maybe try using BindableLayout + VerticalStackLayout to set your menu items, instead of using a ListView
Hi @PureWeen,
I tried without the ScrollView layout; the same issue output is replicated. We are required to show the all elements inside the scroll view. Please provide the solution based on the requirement.
My main point was that this layout doesn't seem to make sense
https://github.com/Arunachalam3641/EntryIssueAndroid/blob/main/NavigationViewDemo/NavigationViewDemo/MainPage.xaml#L8-L23
SV => VSL => LV
is redundant
LV is already a scrollable component
Also can you try this? https://github.com/dotnet/maui/issues/19819#issuecomment-1942110800
Hi @PureWeen,
- https://github.com/dotnet/maui/issues/19819#issuecomment-2000594234
I tried using VerticalStackLayout and ListView after removing the ScrollView from the sample. However, there is no change in the output. Please view the attached image. The keyboard still hides the entry.
- https://github.com/dotnet/maui/issues/19819#issuecomment-1942110800
I have also tried using WindowSoftInputModeAdjust="Resize", but the same result persists. The keyboard still hides the entry. Please refer to the attached image below. I tried this approach without using ScrollView.
Any updates on this issue or workaround available ? @PureWeen - This is high priority for us