Skip to content

Commit a1adb44

Browse files
committed
touched to showError
1 parent 0231a3d commit a1adb44

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

components/FieldCoreBase.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { FieldValidation, IFieldValidationContext } from '../validator/context';
77
import CustomMessage from './CustomMessage';
88

99
export interface IStateFieldBase {
10-
touched: boolean;
10+
showError: boolean;
1111
errorMessage: string;
1212
submitted: boolean;
1313
}
@@ -32,14 +32,14 @@ export default class FieldCoreBase<
3232

3333
constructor(props: any) {
3434
super(props);
35-
this.state = { touched: false, error: null } as any;
35+
this.state = { showError: false, errorMessage: null } as S;
3636
}
3737

3838
get errorMessage() {
3939
const { errorMessage: errorProp } = this.props;
40-
const { submitted, touched, errorMessage } = this.state;
40+
const { submitted, showError, errorMessage } = this.state;
4141

42-
return submitted || touched ?
42+
return submitted || showError ?
4343
errorProp || errorMessage : null;
4444
}
4545

@@ -89,7 +89,7 @@ export default class FieldCoreBase<
8989
}
9090

9191
public resetState = () => {
92-
this.setState({ submitted: false, touched: false });
92+
this.setState({ submitted: false, showError: false });
9393
}
9494

9595
public isValid = () => {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"validation",
1010
"material"
1111
],
12-
"version": "1.0.7",
12+
"version": "1.1.0",
1313
"main": "./index.js",
1414
"types": "./index.d.ts",
1515
"license": "MIT",

0 commit comments

Comments
 (0)