【发布时间】:2019-05-02 13:32:33
【问题描述】:
我正在使用来自 formsy-semantic-ui-react 的输入进行表单验证,如何仅在字段有效时运行 onBlur 函数?
formsy-react 中有一个isValid() 函数,this.props.isValid() 但是我如何在来自 formsy-semantic-ui-react 的输入中调用这个函数?
我该怎么做,onBlur={isValid() ? this.updateValue : null}?
<Form.Input
instantValidation={false}
name="input1"
label="Input 1"
validations="isNumeric"
validationErrors={{
isNumeric: "Enter numeric only"
}}
errorLabel={errorLabel}
onBlur={this.updateValue}
/>
【问题讨论】:
标签: reactjs semantic-ui-react formsy-react