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:
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user