Repository: arco-design/arco-design (TypeScript)

Issue:
InputSearch组件与Input组件的onPressEnter冲突，当点击InputSearch组件时，会自动触发onPressEnter事件
- [x] I'm sure this does not appear in [the issue list of the repository](https://github.com/arco-design/arco-design/issues)

## Basic Info 
- **Package Name And Version:** @arco-design/web-react@2.48.0
- **Framework version:** React
- **Browser:** chrome113.0.0.0

## What is expected?
期待InputSearch组件点击时不要触发onPressEnter事件

<!--- Disclaimer: Submitting offensive issues will result in being blocked from arco-design organization. -->
<!-- generated by arco-issue. DO NOT REMOVE -->


Discussion:

Patch:
diff --git a/components/Input/search.tsx b/components/Input/search.tsx
index 7a7367fc4f..385efe2d6d 100644
--- a/components/Input/search.tsx
+++ b/components/Input/search.tsx
@@ -29,9 +29,8 @@ const Search = React.forwardRef<RefInputType, InputSearchProps>((props: InputSea
     className
   );
 
-  const onSearch = (e) => {
+  const onSearch = () => {
     !disabled && props.onSearch && props.onSearch(value);
-    props.onPressEnter && props.onPressEnter(e);
   };
 
   return (
@@ -64,7 +63,10 @@ const Search = React.forwardRef<RefInputType, InputSearchProps>((props: InputSea
         props.onChange && props.onChange(value, e);
       }}
       defaultValue={defaultValue}
-      onPressEnter={onSearch}
+      onPressEnter={(e) => {
+        onSearch();
+        props.onPressEnter && props.onPressEnter(e);
+      }}
     />
   );
 });


Test patch:
diff --git a/components/Input/__test__/index.test.tsx b/components/Input/__test__/index.test.tsx
index bd0c552c2a..1207245677 100644
--- a/components/Input/__test__/index.test.tsx
+++ b/components/Input/__test__/index.test.tsx
@@ -108,7 +108,7 @@ describe('Test Search', () => {
       />
     );
     expect(component.querySelector('button svg')).toHaveClass('arco-icon-search');
-    fireEvent.click(component.querySelector('button'));
+    fireEvent.click(component.querySelector('button') as HTMLElement);
     expect(onSearch.mock.calls[0][0]).toBe('search text');
   });
 
@@ -122,12 +122,37 @@ describe('Test Search', () => {
         defaultValue="custom value"
       />
     );
-    fireEvent.change(component.querySelector('input'));
+    fireEvent.change(component.querySelector('input') as HTMLElement);
     const iconButton = component.find('.arco-icon-search');
     fireEvent.click(iconButton[0]);
 
     expect(onSearch.mock.calls[0][0]).toBe('custom value');
   });
+
+  it('input search (pressenter)', () => {
+    const onSearch = jest.fn();
+    const onPressEnter = jest.fn();
+    const component = mountInputSearch(
+      <Input.Search
+        placeholder="please enter search text"
+        style={{ marginTop: 10, maxWidth: 400 }}
+        onSearch={onSearch}
+        onPressEnter={onPressEnter}
+        defaultValue="custom value"
+      />
+    );
+
+    fireEvent.keyDown(component.querySelector('input') as HTMLElement, { keyCode: Enter.code });
+
+    expect(onSearch.mock.calls[0][0]).toBe('custom value');
+    expect(onPressEnter.mock.calls).toHaveLength(1);
+
+    const iconButton = component.find('.arco-icon-search');
+    fireEvent.click(iconButton[0]);
+
+    expect(onSearch.mock.calls).toHaveLength(2);
+    expect(onPressEnter.mock.calls).toHaveLength(1);
+  });
 });
 
 describe('Test Textarea', () => {