fix: should consider IME composition
This commit is contained in:
@@ -87,7 +87,10 @@ export function EditorAgentDraftTextarea({
|
||||
}, []);
|
||||
|
||||
const handleKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {
|
||||
if (event.key === 'Enter' && !event.shiftKey) {
|
||||
if (event.key === 'Enter'
|
||||
&& !event.shiftKey
|
||||
&& !event.nativeEvent.isComposing
|
||||
) {
|
||||
event.preventDefault();
|
||||
event.currentTarget.form?.requestSubmit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user