[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:
parent
26950abb61
commit
b2f7fcc346
1 changed files with 3 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue