Skip to content

Commit

Permalink
fix: button clear in form block
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Mar 14, 2024
1 parent 9a10ff8 commit 68c8bf8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/customizations/volto-form-block/components/FormView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,15 @@ const FormView = ({
<br />
</>
)}
<Button color="primary" outline onClick={resetFormState}>
<Button
color="primary"
outline
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
resetFormState();
}}
>
{intl.formatMessage(messages.reset)}
</Button>
</Alert>
Expand Down Expand Up @@ -263,7 +271,11 @@ const FormView = ({
<Button
color="secondary"
type="button"
onClick={resetFormState}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
resetFormState();
}}
className="me-2"
>
{data.cancel_label ||
Expand Down

0 comments on commit 68c8bf8

Please sign in to comment.