wrap chain source, rescan and wallet-rename fields in real forms

three input sites lived in a div instead of a form, so pressing enter did
nothing and the button was the only way in. chain source url, rescan search
depth, and the inline wallet-rename field all get a <form onSubmit>, with
every non-submit button in each marked type="button" (the rescan card's
reset button was previously untyped, which would have submitted the form
once wrapped).

CoinsView.tsx has no text inputs (checkbox + buttons only) and
SeedPhraseInput.tsx deliberately hijacks enter to advance between word boxes
rather than submit, so both are left alone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-19 10:42:35 +00:00
co-authored by Claude Opus 5
parent 00ea1acf75
commit 302d8b48c7
3 changed files with 23 additions and 17 deletions
+9 -3
View File
@@ -37,8 +37,14 @@ export const RescanCard = ({ walletId }: RescanCardProps) => {
const parsed = Number(gapLimit);
const depth = gapLimit.trim() && Number.isInteger(parsed) && parsed > 0 ? parsed : null;
const submit = (ev?: React.FormEvent) => {
ev?.preventDefault();
if (running || rescan.isPending) return;
rescan.mutate(depth ? { gapLimit: depth } : {});
};
return (
<section className="max-w-2xl rounded-xl border border-border p-4">
<form onSubmit={submit} className="max-w-2xl rounded-xl border border-border p-4">
<h3 className="mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
Find missing coins
</h3>
@@ -50,9 +56,9 @@ export const RescanCard = ({ walletId }: RescanCardProps) => {
<div className="flex flex-wrap items-center gap-2">
<Button
type="submit"
size="sm"
variant="outline"
onClick={() => rescan.mutate(depth ? { gapLimit: depth } : {})}
disabled={running || rescan.isPending}
>
{running || rescan.isPending ? (
@@ -82,7 +88,7 @@ export const RescanCard = ({ walletId }: RescanCardProps) => {
</div>
{state && <Status state={state} />}
</section>
</form>
);
};