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:
@@ -91,8 +91,7 @@ export function Composer({
|
||||
});
|
||||
}
|
||||
|
||||
async function submit(e: React.FormEvent) {
|
||||
e.preventDefault();
|
||||
async function submit() {
|
||||
if (!text.trim() || busy) return;
|
||||
const final = convertEmoticons(text, text.length, true).text;
|
||||
if (await onSubmit(final)) {
|
||||
@@ -101,8 +100,10 @@ export function Composer({
|
||||
}
|
||||
}
|
||||
|
||||
// Not a <form>: iOS Safari offers its card and address AutoFill for the text
|
||||
// boxes of a form. The button sends; Ctrl/Cmd+Enter too.
|
||||
return (
|
||||
<form className="fc" onSubmit={submit}>
|
||||
<div className="fc" data-kb-block>
|
||||
<label htmlFor={id} className="sr-only">
|
||||
{label}
|
||||
</label>
|
||||
@@ -120,6 +121,10 @@ export function Composer({
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Escape") setSuggest(null);
|
||||
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
||||
e.preventDefault();
|
||||
void submit();
|
||||
}
|
||||
}}
|
||||
maxLength={10000}
|
||||
autoComplete="off"
|
||||
@@ -150,10 +155,15 @@ export function Composer({
|
||||
Mégse
|
||||
</button>
|
||||
)}
|
||||
<button type="submit" className="btn btn-primary btn-sm" disabled={busy || !text.trim()}>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm"
|
||||
disabled={busy || !text.trim()}
|
||||
onClick={() => void submit()}
|
||||
>
|
||||
{busy ? "Küldés…" : submitLabel}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user