Fix: Prevent form submission during IME composition (#934)

This fix addresses issue #919 where pressing Enter during IME (Input Method Editor)
composition incorrectly triggers form submission in task title and description fields.

Changes:
- Add isComposing check to Input component's Enter key handler
- Add isComposing check to AutoExpandingTextarea component's Enter key handler

This ensures that Enter key during IME composition (e.g., Japanese, Chinese, Korean input)
only confirms the text conversion without accidentally submitting the form.

Fixes #919
This commit is contained in:
hayato iida
2025-10-04 22:30:46 +09:00
committed by GitHub
parent 8a9f398aaf
commit 567b4a0411
2 changed files with 2 additions and 2 deletions

View File

@@ -50,7 +50,7 @@ const AutoExpandingTextarea = React.forwardRef<
// Handle keyboard shortcuts
const handleKeyDown = React.useCallback(
(e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (e.key === 'Enter') {
if (e.key === 'Enter' && !e.nativeEvent.isComposing) {
if (e.metaKey && e.shiftKey) {
onCommandShiftEnter?.(e);
} else if (e.metaKey) {

View File

@@ -23,7 +23,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
if (e.key === 'Escape') {
e.currentTarget.blur();
}
if (e.key === 'Enter') {
if (e.key === 'Enter' && !e.nativeEvent.isComposing) {
if (e.metaKey && e.shiftKey) {
onCommandShiftEnter?.(e);
} else {