maui icon indicating copy to clipboard operation
maui copied to clipboard

Entry hides while keyboard popup on Android.

Open Arunachalam3641 opened this issue 7 months ago • 3 comments

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

NavigationViewDemo (3).zip

Steps to Reproduce

  1. Run the attached sample
  2. Click the button "Show NavigationView on the right side" button.
  3. Focus the entry on the below right side.
  4. Actual Result: The keyboard hides the entry.
  5. 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 avatar Jan 11 '24 09:01 Arunachalam3641

@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?

PureWeen avatar Jan 11 '24 19:01 PureWeen

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.

ghost avatar Jan 11 '24 19:01 ghost

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.

Arunachalam3641 avatar Jan 13 '24 13:01 Arunachalam3641

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

XamlTest avatar Feb 07 '24 09:02 XamlTest

@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

PureWeen avatar Feb 13 '24 18:02 PureWeen

@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.

danielftz avatar Feb 21 '24 23:02 danielftz

@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

danielftz avatar Feb 22 '24 19:02 danielftz

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

PureWeen avatar Mar 15 '24 22:03 PureWeen

Hi @PureWeen,

  1. 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. image

  1. 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.

image

Arunachalam3641 avatar Mar 18 '24 14:03 Arunachalam3641

Any updates on this issue or workaround available ? @PureWeen - This is high priority for us

Ahamed-Ali avatar Apr 26 '24 12:04 Ahamed-Ali