fix frozen validation input field

This commit is contained in:
or-else
2022-08-27 12:51:52 -07:00
parent 5006a6fb34
commit 22320808fc
5 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ class ValidationView extends React.PureComponent {
this.state = { this.state = {
code: props.credCode || '', code: props.credCode || '',
codeReceived: false codeReceived: props.credCode
}; };
this.handleChange = this.handleChange.bind(this); this.handleChange = this.handleChange.bind(this);
@@ -31,10 +31,10 @@ class ValidationView extends React.PureComponent {
} }
static getDerivedStateFromProps(nextProps, prevState) { static getDerivedStateFromProps(nextProps, prevState) {
if (nextProps.credCode != prevState.code) { if (nextProps.credCode != prevState.codeReceived) {
return { return {
code: nextProps.credCode || '', code: nextProps.credCode || '',
codeReceived: !!nextProps.credCode codeReceived: nextProps.credCode
}; };
} }
+3 -3
View File
@@ -9804,7 +9804,7 @@ class ValidationView extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureC
super(props); super(props);
this.state = { this.state = {
code: props.credCode || '', code: props.credCode || '',
codeReceived: false codeReceived: props.credCode
}; };
this.handleChange = this.handleChange.bind(this); this.handleChange = this.handleChange.bind(this);
this.handleKeyPress = this.handleKeyPress.bind(this); this.handleKeyPress = this.handleKeyPress.bind(this);
@@ -9813,10 +9813,10 @@ class ValidationView extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureC
} }
static getDerivedStateFromProps(nextProps, prevState) { static getDerivedStateFromProps(nextProps, prevState) {
if (nextProps.credCode != prevState.code) { if (nextProps.credCode != prevState.codeReceived) {
return { return {
code: nextProps.credCode || '', code: nextProps.credCode || '',
codeReceived: !!nextProps.credCode codeReceived: nextProps.credCode
}; };
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long