[MM-11454] Update the value of QuickTextInput on componentDidUpdate (#1941)

* update the value of QuickTextInput on componentDidUpdate

* update condition in updating input from props
This commit is contained in:
Saturnino Abril 2018-07-31 23:50:20 +08:00 committed by Harrison Healey
parent 26950abb61
commit b2f7fcc346

View file

@ -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();
}