Skip to content

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

Merged
merged 5 commits into from
May 4, 2020
Merged

Conversation

guywix
Copy link
Contributor

@guywix guywix commented Apr 20, 2020

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

@guywix guywix requested a review from ethanshar April 27, 2020 08:31
Copy link
Collaborator

@ethanshar ethanshar left a 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.

Comment on lines 272 to 274
const isTagNotValidate = this.checkTagValidate(tag, validationErrorMessage);

if (isTagNotValidate) {
Copy link
Collaborator

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

Suggested change
const isTagNotValidate = this.checkTagValidate(tag, validationErrorMessage);
if (isTagNotValidate) {
if (tag.invalid) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


return (
<View style={[!hideUnderline && styles.withUnderline, containerStyle]}>
<View style={styles.tagsList}>
{_.map(tags, tagRenderFn)}
{this.renderTextInput()}
</View>
<View>
Copy link
Collaborator

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

Copy link
Contributor Author

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

@ethanshar ethanshar merged commit 84c11b0 into master May 4, 2020
@ethanshar ethanshar deleted the tagsValidation branch July 26, 2021 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants