+
@@ -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();
+ }
+ }}
/>
Kérjük, tartsd be a házirendet.
-
@@ -219,6 +232,6 @@ export function NewThreadForm({
{error}
)}
-
+
);
}
diff --git a/services/frontend/src/components/KeyboardSafe.tsx b/services/frontend/src/components/KeyboardSafe.tsx
index 1183fef..f91d60d 100644
--- a/services/frontend/src/components/KeyboardSafe.tsx
+++ b/services/frontend/src/components/KeyboardSafe.tsx
@@ -51,7 +51,8 @@ export function KeyboardSafe() {
measure();
const top = vv ? vv.offsetTop : 0;
const height = vv ? vv.height : window.innerHeight;
- const form = el.closest("form");
+ // The box with its send button: a form, or a block marked for it.
+ const form = el.closest("form, [data-kb-block]");
const target = form && form.getBoundingClientRect().height < height * 0.6 ? form : el;
const rect = target.getBoundingClientRect();
const free = { top: top + 12, bottom: top + height - 16 };
diff --git a/services/frontend/src/components/forum/Composer.tsx b/services/frontend/src/components/forum/Composer.tsx
index adfd326..e96ba7c 100644
--- a/services/frontend/src/components/forum/Composer.tsx
+++ b/services/frontend/src/components/forum/Composer.tsx
@@ -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
+
);
}