diff --git a/app/components/layout/keyboard_layout/keyboard_layout.js b/app/components/layout/keyboard_layout/keyboard_layout.js index 6a3377b65..cf342412e 100644 --- a/app/components/layout/keyboard_layout/keyboard_layout.js +++ b/app/components/layout/keyboard_layout/keyboard_layout.js @@ -3,12 +3,10 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Animated, Keyboard, Platform, View} from 'react-native'; +import {Keyboard, Platform, View} from 'react-native'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; -const {View: AnimatedView} = Animated; - export default class KeyboardLayout extends PureComponent { static propTypes = { children: PropTypes.node, @@ -25,7 +23,7 @@ export default class KeyboardLayout extends PureComponent { this.subscriptions = []; this.count = 0; this.state = { - bottom: new Animated.Value(0), + bottom: 0, }; } @@ -42,26 +40,20 @@ export default class KeyboardLayout extends PureComponent { this.subscriptions.forEach((sub) => sub.remove()); } - onKeyboardWillHide = (e) => { - const {duration} = e; - Animated.timing(this.state.bottom, { - toValue: 0, - duration, - }).start(); + onKeyboardWillHide = () => { + this.setState({bottom: 0}); }; onKeyboardChange = (e) => { if (!e) { - this.setState({bottom: new Animated.Value(0)}); + this.setState({bottom: 0}); return; } - const {endCoordinates, duration} = e; + const {endCoordinates} = e; const {height} = endCoordinates; - Animated.timing(this.state.bottom, { - toValue: height, - duration, - }).start(); + + this.setState({bottom: height}); }; render() { @@ -80,11 +72,11 @@ export default class KeyboardLayout extends PureComponent { } return ( - {children} - + ); } }