Skip to content

Commit

Permalink
hack against scientific form for numbers less then 1 and fully reset …
Browse files Browse the repository at this point in the history
…edit form to blank and not nonedited event
  • Loading branch information
Sinamon-maker authored and igor.la committed Aug 19, 2024
1 parent b867e5c commit 695f9da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/components/event/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const dataFromLocalStorage = (initialValues: EventFormType) => {
return copy;
};
const { meta, values, handleSubmit, setFieldValue, handleReset } = useForm<EventFormType>({
const { meta, values, handleSubmit, setFieldValue, resetForm } = useForm<EventFormType>({
validationSchema: schema,
initialValues:
localStorage.getItem(LocalStorageEnum.EVENT_DATA) !== null
Expand Down Expand Up @@ -165,7 +165,8 @@ const onSubmit = handleSubmit(
isLoading.value = true;
emit('submitEvent', payload);
handleReset();
//in case edit we need reset form and use blank initial values (not previous notedited event)
resetForm({ values: getInitialEventFormValues() });
isLoading.value = false;
},
() => {
Expand Down

0 comments on commit 695f9da

Please sign in to comment.