From 5d4e820988d4f3676ba5fc1ccadb0e214a9437c0 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 14 Dec 2020 13:30:25 -0300 Subject: [PATCH] [FIX] Empty space on Messagebox (#2704) Co-authored-by: Diego Mello --- app/containers/MessageBox/index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/containers/MessageBox/index.js b/app/containers/MessageBox/index.js index a5470566..f3983905 100644 --- a/app/containers/MessageBox/index.js +++ b/app/containers/MessageBox/index.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { - View, Alert, Keyboard, NativeModules, Text + View, Alert, Keyboard, NativeModules, Text, InteractionManager } from 'react-native'; import { connect } from 'react-redux'; import { KeyboardAccessoryView } from 'react-native-ui-lib/keyboard'; @@ -222,9 +222,14 @@ class MessageBox extends Component { } this.unsubscribeFocus = navigation.addListener('focus', () => { - if (this.tracking && this.tracking.resetTracking) { - this.tracking.resetTracking(); - } + // didFocus + // We should wait pushed views be dismissed + InteractionManager.runAfterInteractions(() => { + if (this.tracking && this.tracking.resetTracking) { + // Reset messageBox keyboard tracking + this.tracking.resetTracking(); + } + }); }); this.unsubscribeBlur = navigation.addListener('blur', () => { this.component?.blur();