Fix consistuenta submition

This commit is contained in:
IRBorisov 2023-08-27 19:30:37 +03:00
parent 6cd7143da0
commit be360312d4

View File

@ -75,8 +75,10 @@ function EditorConstituenta({ activeID, onShowAST, onCreateCst, onRenameCst, onO
} }
}, [activeCst, onOpenEdit, schema]); }, [activeCst, onOpenEdit, schema]);
function handleSubmit(event: React.FormEvent<HTMLFormElement>) { function handleSubmit(event?: React.FormEvent<HTMLFormElement>) {
if (event) {
event.preventDefault(); event.preventDefault();
}
if (!activeID || processing) { if (!activeID || processing) {
return; return;
} }
@ -135,6 +137,7 @@ function EditorConstituenta({ activeID, onShowAST, onCreateCst, onRenameCst, onO
tooltip='Сохранить изменения' tooltip='Сохранить изменения'
disabled={!isModified || !isEnabled} disabled={!isModified || !isEnabled}
icon={<SaveIcon size={6} color={isModified && isEnabled ? 'text-primary' : ''}/>} icon={<SaveIcon size={6} color={isModified && isEnabled ? 'text-primary' : ''}/>}
onClick={() => handleSubmit()}
> >
</MiniButton> </MiniButton>
</div> </div>