[FIX] Empty space on Messagebox (#2704)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Djorkaeff Alexandre 2020-12-14 13:30:25 -03:00 committed by GitHub
parent f5b9dc6fe9
commit 5d4e820988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { import {
View, Alert, Keyboard, NativeModules, Text View, Alert, Keyboard, NativeModules, Text, InteractionManager
} from 'react-native'; } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { KeyboardAccessoryView } from 'react-native-ui-lib/keyboard'; import { KeyboardAccessoryView } from 'react-native-ui-lib/keyboard';
@ -222,10 +222,15 @@ class MessageBox extends Component {
} }
this.unsubscribeFocus = navigation.addListener('focus', () => { this.unsubscribeFocus = navigation.addListener('focus', () => {
// didFocus
// We should wait pushed views be dismissed
InteractionManager.runAfterInteractions(() => {
if (this.tracking && this.tracking.resetTracking) { if (this.tracking && this.tracking.resetTracking) {
// Reset messageBox keyboard tracking
this.tracking.resetTracking(); this.tracking.resetTracking();
} }
}); });
});
this.unsubscribeBlur = navigation.addListener('blur', () => { this.unsubscribeBlur = navigation.addListener('blur', () => {
this.component?.blur(); this.component?.blur();
}); });