In forgot password screen, show validation errors inline in the form, instead of in modals (#7113)
This commit is contained in:
parent
a16e6dab4d
commit
646f87b2db
3 changed files with 72 additions and 62 deletions
|
@ -38,7 +38,7 @@ interface IProps extends Omit<IInputProps, "onValidate"> {
|
|||
labelAllowedButUnsafe?: string;
|
||||
|
||||
onChange(ev: React.FormEvent<HTMLElement>);
|
||||
onValidate(result: IValidationResult);
|
||||
onValidate?(result: IValidationResult);
|
||||
}
|
||||
|
||||
@replaceableComponent("views.auth.PassphraseField")
|
||||
|
@ -98,7 +98,9 @@ class PassphraseField extends PureComponent<IProps> {
|
|||
|
||||
onValidate = async (fieldState: IFieldState) => {
|
||||
const result = await this.validate(fieldState);
|
||||
this.props.onValidate(result);
|
||||
if (this.props.onValidate) {
|
||||
this.props.onValidate(result);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue