Skip to content

Commit

Permalink
CB-4618 Profile, changing password - after a successful change red bo…
Browse files Browse the repository at this point in the history
…rders appear (#2820)

* CB-4618 removes red border after form submission

* Revert "CB-4618 removes red border after form submission"

This reverts commit 703da4e.

* CB-4618 removes red border after form submission in useForm hook

---------

Co-authored-by: Evgenia Bezborodova <[email protected]>
  • Loading branch information
sergeyteleshev and EvgeniaBzzz authored Aug 6, 2024
1 parent ffee7a1 commit 23b7044
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webapp/packages/core-blocks/src/FormControls/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ export function useForm(options?: IOptions): IFormContext {
async submit(event) {
if (this.parent) {
await this.parent.submit(event);
this.ref?.reset();
} else {
event?.preventDefault();

if (this.validate()) {
await this.onSubmit.execute(event);
this.ref?.reset();
}
}
},
Expand Down

0 comments on commit 23b7044

Please sign in to comment.