Skip to content

Commit 4534b81

Browse files
Merge pull request #242 from GetStream/vishal/keyboard-fix
Fixing Animated values on KeyboardCompatibleView
2 parents ae7317d + 88721a0 commit 4534b81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/KeyboardCompatibleView.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class KeyboardCompatibleView extends React.PureComponent {
4242
super(props);
4343

4444
this.state = {
45-
channelHeight: new Animated.Value('100%'),
45+
channelHeight: new Animated.Value(0),
4646
// For some reason UI doesn't update sometimes, when state is updated using setValue.
4747
// So to force update the component, I am using following key, which will be incremented
4848
// for every keyboard slide up and down.
@@ -54,7 +54,7 @@ export class KeyboardCompatibleView extends React.PureComponent {
5454
// Following variable takes care of race condition between keyboardDidHide and keyboardDidShow.
5555
this._hidingKeyboardInProgress = false;
5656
this.rootChannelView = false;
57-
this.initialHeight = undefined;
57+
this.initialHeight = 0;
5858
}
5959

6060
componentDidMount() {
@@ -100,7 +100,7 @@ export class KeyboardCompatibleView extends React.PureComponent {
100100
* adjust the view instead of having no difference in value to animate to
101101
*/
102102
this.setState({ channelHeight: new Animated.Value(this.initialHeight) });
103-
this.initialHeight = undefined;
103+
this.initialHeight = 0;
104104
this.dismissKeyboard();
105105
this.removeKeyboardListeners();
106106
this.setState({ appState: nextAppState });

0 commit comments

Comments
 (0)