Skip to content

Commit

Permalink
Merge pull request #2 from maxiru/fix/MultipleResetKeyboardSpace
Browse files Browse the repository at this point in the history
Do not animate layout if keyboard state is not changed
  • Loading branch information
SnaiNeR authored Jun 10, 2020
2 parents b380a16 + 5dad02a commit cfe6e03
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion KeyboardSpacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class KeyboardSpacer extends Component {
}

updateKeyboardSpace(event) {
if (!event.endCoordinates) {
if (!event.endCoordinates || this.state.isKeyboardOpened) {
return;
}

Expand All @@ -113,6 +113,10 @@ export default class KeyboardSpacer extends Component {
}

resetKeyboardSpace(event) {
if (!this.state.isKeyboardOpened) {
return;
}

let animationConfig = defaultAnimation;
if (Platform.OS === 'ios') {
animationConfig = LayoutAnimation.create(
Expand Down

0 comments on commit cfe6e03

Please sign in to comment.