Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug][Android] Keyboard issue with LayoutNoLimits on Samsung devices with Android 11 #14067

Open
rickclephas opened this issue Mar 26, 2021 · 2 comments

Comments

@rickclephas
Copy link

rickclephas commented Mar 26, 2021

Description

On Samsung devices running Android 11 there is an issue with the WindowSoftInputMode when WindowManagerFlags.LayoutNoLimits is set. After closing the keyboard the app doesn't return to it's normal state and shows a black bar at the bottom of the screen:

Steps to Reproduce

  1. Create a new Forms project
  2. Set the WindowManagerFlags.LayoutNoLimits in the OnCreate of the MainActivity:
Window?.AddFlags(WindowManagerFlags.LayoutNoLimits);
  1. Add an Entry to the bottom of the MainPage:
<ScrollView BackgroundColor="Purple">
    <StackLayout BackgroundColor="Green">
        <BoxView HeightRequest="1000"
                 Color="Red"/>
        <Entry BackgroundColor="Blue"/>
        <BoxView HeightRequest="100"
                 Color="Brown"/>
    </StackLayout>
</ScrollView>
  1. Start the app and focus on the Entry
  2. Now hide the keyboard

Expected Behavior

The app is moved up when the keyboard is shown and moved back down when it is hidden.
NOTE: this is exactly how it works on e.g. a Google Pixel 3a XL running Android 11.

Actual Behavior

There is a black bar at the bottom of the screen after the keyboard is hidden.

Basic Information

  • Version with issue: 5.0.0.2012
  • Platform Target Frameworks:
    • Android 11
  • Affected Devices:
    • Samsung devices running Android 11

Screenshots

Screenshot_20210326-112448

Reproduction Link

XFSamsungA11KeyboardBug.zip

@rickclephas rickclephas added s/unverified New report that has yet to be verified t/bug 🐛 labels Mar 26, 2021
@rachelkang
Copy link
Contributor

Wasn't able to repro on a Samsung device with Android 7 - will try to look for a Samsung device on Android 11 and try again

@rickclephas
Copy link
Author

@rachelkang that's correct. I couldn't reproduce this on older Android versions either. So far it seems to only affect Samsung devices on Android 11.

I should also note that there is a difference in behavior between Android 10 and 11. On Android 10 the entry stays hidden behind the keyboard while on Android 11 it stays above the keyboard.

Maybe the new Android 11 APIs for IME transitions have something to do with this?

The behavior difference doesn't seem like a big problem to me but the bug on Samsung devices definitely is!

The only way to get rid of the black bar is to either focus on an entry that is always shown above the keyboard or switch between apps.

P.S. the behavior difference is the same with a native Android app but I wasn't able to reproduce the bug in a native app so that seems to be something Xamarin Forms related.

@jsuarezruiz jsuarezruiz removed the s/unverified New report that has yet to be verified label Jun 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants