fixing form submit
This commit is contained in:
parent
f54e3c683c
commit
e9254ece60
|
|
@ -169,16 +169,10 @@ export const Form: FC<FMProps> = (props) => {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<form
|
<form
|
||||||
onSubmit={(e) => {
|
onSubmit={async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
fm.status = "saving";
|
await fm.submit();
|
||||||
fm.render();
|
|
||||||
|
|
||||||
fm.submit();
|
|
||||||
|
|
||||||
fm.status = "ready";
|
|
||||||
fm.render();
|
|
||||||
}}
|
}}
|
||||||
ref={(el) => {
|
ref={(el) => {
|
||||||
if (el) {
|
if (el) {
|
||||||
|
|
|
||||||
|
|
@ -264,10 +264,8 @@ export const formInit = (fm: FMLocal, props: FMProps) => {
|
||||||
|
|
||||||
toast.dismiss();
|
toast.dismiss();
|
||||||
|
|
||||||
if (!success) {
|
|
||||||
fm.status = "ready";
|
fm.status = "ready";
|
||||||
fm.render();
|
fm.render();
|
||||||
}
|
|
||||||
|
|
||||||
if (fm.props.sonar === "on" && !isEditor) {
|
if (fm.props.sonar === "on" && !isEditor) {
|
||||||
toast.dismiss();
|
toast.dismiss();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue