[iOS] Text Input Out of Position
See original GitHub issueIssue Description
On iOS when the keyboard is visible, the text input is shifted up. It goes up halfway where there are no messages and to the top when there are messages.
(Android works fine.)
On in initial render. Looks good.
Typing the first message. There’s a gap between the keyboard and the text input.
After send of first message. The gap remains until the keyboard is dismissed.
Typing second message. The gap is enlarged such that the text input is at the top.
Steps to Reproduce / Code Snippets
My code. As you can see, it’s dead simple.
class Discuss extends Component {
state = {
messages: [],
};
onSend(messages = []) {
this.setState(state => ({
messages: GiftedChat.append(state.messages, messages),
}));
setTimeout(() => {
const response = getFakeResonse();
this.setState(state => ({
messages: GiftedChat.append(state.messages, response),
}));
}, 3000);
}
render() {
return (
<GiftedChat
messages={this.state.messages}
onSend={(messages) => this.onSend(messages)}
user={{
_id: 1,
}}
/>
);
}
}
Expected Results
The text input should remain just above the keyboard.
Additional Information
- React Native version: 0.48.4
- react-native-gifted-chat version: 0.2.7
- Platform(s) (iOS, Android, or both?): iOS only
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:18 (1 by maintainers)
Top Results From Across the Web
Cursor moves outside text field - … | Apple Developer Forums
Cursor moves outside text field - iOS Safari The cursor doesn't stay in the text field when you scroll up and down if...
Read more >Text in TextInput not in correct position on ios - Stack Overflow
I have a textInput in a View which is positioned at the center using flex . the problem is, when you start writing...
Read more >[iOS] Text input begins at the end of the ... - Unity Issue Tracker
[iOS] Text input begins at the end of the text when the caret position is in the middle of the text · 1....
Read more >KeyboardAvoidingView - React Native
KeyboardAvoidingView. This component will automatically adjust its height, position, or bottom padding based on the keyboard height to ...
Read more >ion-input: Custom Input Value Type Styling and CSS Properties
ion-input is a wrapper to the HTML input element, with custom value type styling and functionality. It works on desktops and integrates with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m having similar issue but in my case TextInput remains behind keyboard, I’m testing using Expo and my environment is react-native 0.48.4 and react-native-gifted-chat 0.2.9… see attachments…

Nice solution can be found on this ticket - https://github.com/FaridSafi/react-native-gifted-chat/issues/874