-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Description
Description
After having had a populated error, removing the error will not actually remove the error from the DOM. Although there is a conditional, the Transition component will keep the outputted error div in its state.
Solution
Still need to research
Additional Information
As "show-message" is not implemented, and since we use the validation capabilities of react-jsonschema-form, we have overridden the onFieldBlur method of Form.Item:
class ValidatingFormItem extends Form.Item {
onFieldBlur() {
this.validate('blur');
if (this.props['show-message'] && this.props.error) {
this.setState(curState => {
let newState = {
...curState,
error: this.props.error
}
return newState;
});
} else {
this.setState(curState => {
let newState = {
...curState,
error: ""
};
newState.valid = true;
return newState;
});
}
this.forceUpdate();
}
}
Form.Item = ValidatingFormItem;
Metadata
Metadata
Assignees
Labels
No labels