fix: prevent duplicate submissions during IME composition
This commit is contained in:
@@ -339,7 +339,12 @@ export function Thread() {
|
|||||||
value={input}
|
value={input}
|
||||||
onChange={(e) => setInput(e.target.value)}
|
onChange={(e) => setInput(e.target.value)}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === "Enter" && !e.shiftKey && !e.metaKey) {
|
if (
|
||||||
|
e.key === "Enter" &&
|
||||||
|
!e.shiftKey &&
|
||||||
|
!e.metaKey &&
|
||||||
|
!e.nativeEvent.isComposing
|
||||||
|
) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const el = e.target as HTMLElement | undefined;
|
const el = e.target as HTMLElement | undefined;
|
||||||
const form = el?.closest("form");
|
const form = el?.closest("form");
|
||||||
|
|||||||
Reference in New Issue
Block a user