-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBW-97 Add 'required' option for string inputs #227
Conversation
f97a5c7
to
5f6a8f9
Compare
}, | ||
|
||
isValid () { | ||
return this.props.params.nullable ? true : this.isFilled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return this.props.params.nullable || this.isFilled();
}, | ||
|
||
isValid () { | ||
return this.props.params.nullable ? true : this.isFilled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.props.params.nullable || this.isFilled();
@@ -185,11 +192,26 @@ modulejs.define('HBWFormString', ['React', 'jQuery'], (React, jQuery) => { | |||
}, | |||
|
|||
isValid () { | |||
return (this.state.value || '').search(new RegExp(this.props.params.regex)) >= 0; | |||
const requiredOK = this.props.params.required ? this.isFilled() : true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!this.props.params.required || this.isFilled()
@@ -185,11 +192,26 @@ modulejs.define('HBWFormString', ['React', 'jQuery'], (React, jQuery) => { | |||
}, | |||
|
|||
isValid () { | |||
return (this.state.value || '').search(new RegExp(this.props.params.regex)) >= 0; | |||
const requiredOK = this.props.params.required ? this.isFilled() : true; | |||
const regexOK = this.props.params.regex ? this.regexMatched() : true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, you know...
* Use `nullable: false` in select/select_table for the same purposes
nullable: false
in select/select_table for the same purposes