Set submit type in submit buttons

This commit is contained in:
Alejandro Celaya 2025-04-05 14:09:57 +02:00
parent 0a7a606541
commit 3d6ea5cf7c
3 changed files with 4 additions and 10 deletions

View File

@ -73,7 +73,7 @@ const CreateServer: FCWithDeps<CreateServerProps, CreateServerDeps> = ({ servers
{!hasServers && (
<ImportServersBtn tooltipPlacement="top" onImport={setServersImported} onError={setErrorImporting} />
)}
{hasServers && <Button type="button" variant="secondary" onClick={goBack}>Cancel</Button>}
{hasServers && <Button variant="secondary" onClick={goBack}>Cancel</Button>}
<Button type="submit">Create server</Button>
</ServerForm>

View File

@ -44,8 +44,8 @@ const EditServer: FCWithDeps<EditServerProps, EditServerDeps> = withSelectedServ
initialValues={selectedServer}
onSubmit={handleSubmit}
>
<Button type="button" variant="secondary" onClick={goBack}>Cancel</Button>
<Button>Save</Button>
<Button variant="secondary" onClick={goBack}>Cancel</Button>
<Button type="submit">Save</Button>
</ServerForm>
</NoMenuLayout>
);

View File

@ -84,13 +84,7 @@ const ImportServersBtn: FCWithDeps<ImportServersBtnConnectProps, ImportServersBt
return (
<>
<Button
type="button"
variant="secondary"
id="importBtn"
className={className}
onClick={() => ref.current?.click()}
>
<Button variant="secondary" id="importBtn" className={className} onClick={() => ref.current?.click()}>
<FontAwesomeIcon icon={importIcon} fixedWidth /> {children ?? 'Import from file'}
</Button>
<UncontrolledTooltip placement={tooltipPlacement} target="importBtn">