diff --git a/package.json b/package.json index 3785dbb..2077cc8 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ }, "dependencies": { "classnames": "^2.2.1", - "@rc-component/input": "~1.0.0", + "@rc-component/input": "~1.1.0", "@rc-component/resize-observer": "^1.0.0", "@rc-component/util": "^1.2.0" }, diff --git a/src/TextArea.tsx b/src/TextArea.tsx index 67e189b..20038ce 100644 --- a/src/TextArea.tsx +++ b/src/TextArea.tsx @@ -154,7 +154,7 @@ const TextArea = React.forwardRef( }; const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === 'Enter' && onPressEnter) { + if (e.key === 'Enter' && onPressEnter && !e.nativeEvent.isComposing) { onPressEnter(e); } onKeyDown?.(e); diff --git a/tests/__snapshots__/allowClear.test.tsx.snap b/tests/__snapshots__/allowClear.test.tsx.snap index db1093c..a9783b9 100644 --- a/tests/__snapshots__/allowClear.test.tsx.snap +++ b/tests/__snapshots__/allowClear.test.tsx.snap @@ -12,6 +12,7 @@ exports[`should support allowClear should not show icon if defaultValue is undef >