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

Keyboard height is wrong on some android devices (causing the keyboard to show over text inputs) #26461

Closed
vandrieu opened this issue Sep 16, 2019 · 4 comments
Labels
API: Keyboard Bug Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@vandrieu
Copy link

When the keyboard is show, the 'keyboardDidShow' event is fired.

We listen to it like this:

Keyboard.addListener('keyboardDidShow', this.handleKeyboardDidShow)

When it's fired, we start an Animated.Value that goes from 0 to -keyboardHeight to move the main view up (there are better ways to handle it, but that's not the point, I'm just trying to keep it simple here)

handleKeyboardDidShow = (event) => {
	Animated.timing(
		this.state.moveUpValue,
		{
			toValue: -event.endCoordinates.height,
			duration: 200,
			easing: Easing.linear
		}
	).start();
}

The main view is like:

<Animated.View style={{ transform: [{ translateY: this.state.moveUpValue }] }}>
</Animated.View>

It works on all iOS devices and it works on most Android devices, but on some Android devices, the event.endCoordinates.height value is wrong, causing the text input to be partially hidden.

This is a Huawei P20 Pro:

IMG-20190425-WA0006

This is a Samsung A40:

IMG-20190916-WA0001

How are we supposed to deal with that?

@react-native-bot
Copy link
Collaborator

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Sep 16, 2019
@vandrieu
Copy link
Author

Yes, I inserted code samples to reproduce the issue, as required.

@stale
Copy link

stale bot commented Dec 16, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 16, 2019
@stale
Copy link

stale bot commented Dec 23, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Dec 23, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Dec 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Keyboard Bug Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants