nayanthulkar28 commented on code in PR #935:
URL: https://github.com/apache/incubator-answer/pull/935#discussion_r1592349757
##########
ui/src/pages/Questions/Ask/index.tsx:
##########
@@ -452,18 +448,18 @@ const Ask = () => {
{formData.content.errorMsg}
</Form.Control.Feedback>
</Form.Group>
+
<Form.Group controlId="tags" className="my-3">
<Form.Label>{t('form.fields.tags.label')}</Form.Label>
- <Form.Control
- defaultValue={JSON.stringify(formData.tags.value)}
- isInvalid={formData.tags.isInvalid}
- hidden
- />
Review Comment:
I got the issue that if classes ```custom-form-control``` and
```is-invalid``` both are not present in the child component of
```<Form.Group>``` component, the ```<Form.Control.Feedback>``` tag will not
work. That's why it was not working earlier even though i passed
```is-invalid``` class because the ```is-invalid``` class was assign to its
```child's child``` component and ```<Form.Control.Feedback>``` has not been
validated.

But I didn't completely get your second approach.
Should I suppose to do it this way
```<Form.Group controlId="tags" className="my-3">
<Form.Label>{t('form.fields.tags.label')}</Form.Label>
<TagSelector
value={formData.tags.value}
onChange={handleTagsChange}
showRequiredTag
maxTagLength={5}
formData.tags
}
/>
<Form.Control.Feedback type="invalid">
{formData.tags.errorMsg}
</Form.Control.Feedback>
</Form.Group>
```
And then handle the error conditions inside ```TagSelector``` component?
I'm new to react, please help me to understand the expectations. Thanks you
:)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]