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

iOS Keyboard displays over TextInput field preventing user from seeing it. #415

Closed
mcgsoftware opened this issue Mar 28, 2015 · 13 comments
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@mcgsoftware
Copy link

When a field is displayed in lower part of screen and user taps on it to enter text, the keyboard displays on top of the field forcing the user to scroll to see the field again. The correct behavior should be to slide the underlying window up when the keyboard is being displayed so it doesn't cover the input field.

Replicate bug: Using the UIExplorer text input demo screen, try entering text into a TextField that is on bottom of screen. Keyboard displays on top of TextField and hides the text field from view.

@erikthedeveloper
Copy link

👍 I've also been trying to find a work around for this in the meantime (i.e. something along the lines of onFocus={this._slideViewUpToShowInputElement(refName)}

@bpeters
Copy link

bpeters commented Apr 10, 2015

👍

@meetwudi
Copy link
Contributor

Could you give us an example @erikthedeveloper , I can't get this work :( Thanks!

@ziyadparekh
Copy link

👍

@ericzwong
Copy link

I can't do work
the error message is not a function

@stirman
Copy link

stirman commented Apr 16, 2015

Ahh, good call @erikthedeveloper. Hopefully this behavior will be baked in soon!

@ericzwong
Copy link

@stirman how do you do , can show me show source

@brentvatne
Copy link
Collaborator

If the solution that @wangzhe1995 linked to does not work for anybody, ping me and I'll re-open the issue! 😄

@alejomendoza
Copy link

It would be awesome to see a component/example of a messaging view where the keyboard slides up with the input field. 👍

@comountainclimber
Copy link

comountainclimber commented Aug 25, 2016

As of React Native 0.29 you can use React Native's <KeyboardAvoidingView/>

8b78846

@otoinsa
Copy link

otoinsa commented Feb 21, 2017

KeyboardAvoidingView does not work...
#8855

@mitesh1301
Copy link

Hi All,
i just resolve this issue with alternative solution, by using the animation, Hope this will help

import { Animated, Keyboard} from 'react-native';

constructor(props) {
super(props);

//For the keyboard
this.keyboardHeight = new Animated.Value(0);

}

//For key board
componentWillMount () {
console.log("Keyboard componentWillMount")
this.keyboardWillShowSub = Keyboard.addListener('keyboardWillShow', this.keyboardWillShow);
this.keyboardWillHideSub = Keyboard.addListener('keyboardWillHide', this.keyboardWillHide);
}

componentWillUnmount() {
console.log("Keyboard componentWillUnmount")
this.keyboardWillShowSub.remove();
this.keyboardWillHideSub.remove();
}

keyboardWillShow = (event) => {
console.log("keyboardWillShow")
Animated.parallel([
Animated.timing(this.keyboardHeight, {
duration: event.duration,
toValue: event.endCoordinates.height,
})
]).start();
};

keyboardWillHide = (event) => {
console.log("keyboardWillHide")
Animated.parallel([
Animated.timing(this.keyboardHeight, {
duration: event.duration,
toValue: 0,
})
]).start();
};
render() {
<Animated.View style={[styles.container, { paddingBottom: this.keyboardHeight }]}>
<TextInput ........>

</Animated.View>
}

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests