Phones: the forum's text boxes are not in a form (no card AutoFill on iOS)

iOS Safari kept offering card and address AutoFill for the reply box and
the new thread form despite autocomplete="off": it looks at the whole
<form>. The boxes now sit in plain blocks; the button sends, and so does
Ctrl/Cmd+Enter. KeyboardSafe keeps such a block (data-kb-block) with its
send button above the keyboard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-26 17:18:26 +00:00
co-authored by Claude Opus 5.5
parent a622d30b39
commit 9eff714e6a
3 changed files with 36 additions and 12 deletions
@@ -86,8 +86,8 @@ export function NewThreadForm({
if (t?.listening && intent === "") setIntent("listen");
}
async function submit(e: React.FormEvent) {
e.preventDefault();
async function submit() {
if (busy || !title.trim() || !body.trim() || !topic) return;
setBusy(true);
setError(null);
try {
@@ -109,7 +109,9 @@ export function NewThreadForm({
}
return (
<form className="fnew" onSubmit={submit}>
// Not a <form>: iOS Safari offers its card and address AutoFill for the
// text boxes of a form. The button sends; Ctrl/Cmd+Enter in the text too.
<div className="fnew">
{share && (
<div className="fnew-share">
<ShareCard share={share.card} onRemove={() => setShare(null)} />
@@ -176,7 +178,7 @@ export function NewThreadForm({
{intentHint && <p className="fnew-note">{intentHint}</p>}
</fieldset>
<div className="fnew-paper">
<div className="fnew-paper" data-kb-block>
<label htmlFor="fnew-title" className="sr-only">
Cím
</label>
@@ -203,12 +205,23 @@ export function NewThreadForm({
required
autoComplete="off"
placeholder={intent === "listen" ? "Írd le, ami benned van…" : "Írd le a gondolataidat…"}
onKeyDown={(e) => {
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
e.preventDefault();
void submit();
}
}}
/>
<div className="fnew-foot">
<span className="hint">
Kérjük, tartsd be a <Link href="/aszf#forum">házirendet</Link>.
</span>
<button type="submit" className="btn btn-primary" disabled={busy || !title.trim() || !body.trim() || !topic}>
<button
type="button"
className="btn btn-primary"
disabled={busy || !title.trim() || !body.trim() || !topic}
onClick={() => void submit()}
>
{busy ? "Küldés…" : "Szál indítása"}
</button>
</div>
@@ -219,6 +232,6 @@ export function NewThreadForm({
{error}
</p>
)}
</form>
</div>
);
}