From b2f7fcc3461c6f34501c8a4c952132062c1bdc57 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Tue, 31 Jul 2018 23:50:20 +0800 Subject: [PATCH] [MM-11454] Update the value of QuickTextInput on componentDidUpdate (#1941) * update the value of QuickTextInput on componentDidUpdate * update condition in updating input from props --- app/components/quick_text_input.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/quick_text_input.js b/app/components/quick_text_input.js index 2cac479a0..85c8fba5e 100644 --- a/app/components/quick_text_input.js +++ b/app/components/quick_text_input.js @@ -18,6 +18,7 @@ import {TextInput} from 'react-native'; export default class QuickTextInput extends React.PureComponent { static propTypes = { + editable: PropTypes.bool, onChangeText: PropTypes.func, /** @@ -28,6 +29,7 @@ export default class QuickTextInput extends React.PureComponent { static defaultProps = { delayInputUpdate: false, + editable: true, value: '', }; @@ -59,7 +61,7 @@ export default class QuickTextInput extends React.PureComponent { } componentDidUpdate(prevProps, prevState) { - if (this.props.value !== this.storedValue) { + if (this.props.value !== this.storedValue || !this.props.editable) { this.updateInputFromProps(); }