fix: IME input composing
This commit is contained in:
parent
572ed3d783
commit
eea617686f
@ -1,5 +1,5 @@
|
||||
import "./textarea.css";
|
||||
import { type ChangeEvent, type KeyboardEvent, useContext } from "react";
|
||||
import { useContext } from "react";
|
||||
import ReactTextareaAutocomplete, { TriggerType } from "@webscopeio/react-textarea-autocomplete";
|
||||
import "@webscopeio/react-textarea-autocomplete/style.css";
|
||||
import uniqWith from "lodash/uniqWith";
|
||||
@ -39,13 +39,7 @@ const UserItem = (metadata: MetadataCache) => {
|
||||
);
|
||||
};
|
||||
|
||||
interface TextareaProps {
|
||||
emojis: EmojiTag[];
|
||||
value: string;
|
||||
onChange: (e: ChangeEvent<HTMLTextAreaElement>) => void;
|
||||
onKeyDown: (e: KeyboardEvent<Element>) => void;
|
||||
rows?: number;
|
||||
}
|
||||
type TextareaProps = { emojis: EmojiTag[] } & React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
||||
|
||||
export function Textarea({ emojis, ...props }: TextareaProps) {
|
||||
const system = useContext(SnortContext);
|
||||
|
@ -69,7 +69,7 @@ export function WriteMessage({ link, emojiPacks }: { link: NostrLink; emojiPacks
|
||||
}
|
||||
|
||||
async function onKeyDown(e: React.KeyboardEvent) {
|
||||
if (e.code === "Enter") {
|
||||
if (e.code === "Enter" && !e.nativeEvent.isComposing) {
|
||||
e.preventDefault();
|
||||
await sendChatMessage();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user