-
Notifications
You must be signed in to change notification settings - Fork 734
Added validation error feature to TagsInput #749
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
Conversation
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.
@guywix
Sorry it took me too long to review.
Please go over the comments, let me know if there's something that is not clear.
src/components/tagsInput/index.js
Outdated
const isTagNotValidate = this.checkTagValidate(tag, validationErrorMessage); | ||
|
||
if (isTagNotValidate) { |
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.
It's enough just to check if the tag has the invalid prop
const isTagNotValidate = this.checkTagValidate(tag, validationErrorMessage); | |
if (isTagNotValidate) { | |
if (tag.invalid) { |
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.
done
src/components/tagsInput/index.js
Outdated
|
||
return ( | ||
<View style={[!hideUnderline && styles.withUnderline, containerStyle]}> | ||
<View style={styles.tagsList}> | ||
{_.map(tags, tagRenderFn)} | ||
{this.renderTextInput()} | ||
</View> | ||
<View> |
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.
add condition to the error message so it will render it only if the validationErrorMessage is not undefined
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.
done, not sure if that's what you meant
added new onTagNotValidate prop for the user to write is validation error message, and UI support as asked here: https://app.zeplin.io/project/5934252871cf6fc586d47aeb/screen/5e41125dfaf8a8949a886bf8