Fix input focus loss in NewTaskTab form fields
Some checks failed
CI / lint-and-test (push) Successful in 32s
Deploy Production / deploy (push) Failing after 2m49s
CI / build (push) Failing after 3m32s

Move Field component out of NewTaskTab to prevent React from
remounting input wrappers on every keystroke. Same root cause as
the ProjectsTab DetailView fix.
This commit is contained in:
Julia McGhee
2026-03-21 20:46:06 +00:00
parent af090b1de2
commit a5ef56b052

View File

@@ -465,6 +465,15 @@ function AgentSelector({ value, onChange }: { value: string; onChange: (id: stri
);
}
function Field({ label, children }: { label: string; children: React.ReactNode }) {
return (
<div style={{ display: "flex", flexDirection: "column", gap: tokens.space[1] }}>
<Label color={tokens.color.text2}>{label}</Label>
{children}
</div>
);
}
function NewTaskTab({ onSubmit, mobile, projects, knowledgeDocs }: {
onSubmit: (form: TaskForm) => void;
mobile: boolean;
@@ -492,13 +501,6 @@ function NewTaskTab({ onSubmit, mobile, projects, knowledgeDocs }: {
detail: d.path,
}));
const Field = ({ label, children }: { label: string; children: React.ReactNode }) => (
<div style={{ display: "flex", flexDirection: "column", gap: tokens.space[1] }}>
<Label color={tokens.color.text2}>{label}</Label>
{children}
</div>
);
return (
<div style={{ flex: 1, overflow: "auto", padding: mobile ? tokens.space[4] : tokens.space[5] }}>
<div style={{ maxWidth: 620, margin: "0 auto", display: "flex", flexDirection: "column", gap: tokens.space[4] }}>