Unverified Commit b77603c7 authored by Diego Mello's avatar Diego Mello Committed by GitHub

[FIX] Messagebox tracking lost on pop gesture navigation (#2799)

* Use setTimeout instead of InteractionManager

* Update tracking lib
parent 03302198
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
View, Alert, Keyboard, NativeModules, Text, InteractionManager
View, Alert, Keyboard, NativeModules, Text
} from 'react-native';
import { connect } from 'react-redux';
import { KeyboardAccessoryView } from 'react-native-ui-lib/keyboard';
......@@ -224,12 +224,12 @@ class MessageBox extends Component {
this.unsubscribeFocus = navigation.addListener('focus', () => {
// didFocus
// We should wait pushed views be dismissed
InteractionManager.runAfterInteractions(() => {
this.trackingTimeout = setTimeout(() => {
if (this.tracking && this.tracking.resetTracking) {
// Reset messageBox keyboard tracking
this.tracking.resetTracking();
}
});
}, 500);
});
this.unsubscribeBlur = navigation.addListener('blur', () => {
this.component?.blur();
......@@ -258,6 +258,10 @@ class MessageBox extends Component {
} else if (!nextProps.message) {
this.clearInput();
}
if (this.trackingTimeout) {
clearTimeout(this.trackingTimeout);
this.trackingTimeout = false;
}
}
shouldComponentUpdate(nextProps, nextState) {
......
......@@ -13109,9 +13109,9 @@ react-native-text-size@4.0.0-rc.1:
resolved "https://registry.yarnpkg.com/react-native-text-size/-/react-native-text-size-4.0.0-rc.1.tgz#1e048d345dd6a5a8e1269e0585c1a5948c478da5"
integrity sha512-CysqjU2jK6Yc+a+kEI222pUyTY2ywcU2HqbFqf1KHymW6OPTdvBBHqbEJKL0QiLhQaFYDbqicM+h990s9TP00g==
react-native-ui-lib@RocketChat/react-native-ui-lib:
version "4.2.0"
resolved "https://codeload.github.com/RocketChat/react-native-ui-lib/tar.gz/48478a9567c1d5d6ade8def7297578efb04554ca"
react-native-ui-lib@RocketChat/react-native-ui-lib#minor-improvements:
version "4.2.1"
resolved "https://codeload.github.com/RocketChat/react-native-ui-lib/tar.gz/a80f38aaa947849736ce8643253991cdcb639414"
dependencies:
babel-plugin-transform-inline-environment-variables "^0.0.2"
color "^3.1.0"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment