diff --git a/components/suggestion/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/suggestion/__tests__/__snapshots__/demo-extend.test.ts.snap index 1b199907a..1062cdc9e 100644 --- a/components/suggestion/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/suggestion/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -304,7 +304,117 @@ Array [ ] `; -exports[`renders components/suggestion/demo/block.tsx extend context correctly 2`] = ` +exports[`renders components/suggestion/demo/block.tsx extend context correctly 2`] = `[]`; + +exports[`renders components/suggestion/demo/open.tsx extend context correctly 1`] = ` +Array [ +
Basic
Block
+Get Open State
Customize
## API
@@ -29,7 +30,7 @@ Common props ref:[Common props](/docs/react/common-props)
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| block | Take up the full width | boolean | false | - |
-| children | Custom input box | ({ onTrigger, onKeyDown }) => ReactElement | - | - |
+| children | Custom input box | ({ onTrigger, onKeyDown, open }) => ReactElement | - | - |
| items | Suggestion list | SuggestionItem[] \| ((info: T) => SuggestionItem[]) | - | - |
| open | Controlled open panel | boolean | - | - |
| rootClassName | Root element class name | string | - | - |
diff --git a/components/suggestion/index.tsx b/components/suggestion/index.tsx
index 005a2699b..ec302c9e1 100644
--- a/components/suggestion/index.tsx
+++ b/components/suggestion/index.tsx
@@ -26,6 +26,7 @@ export type SuggestionItem = {
export interface RenderChildrenProps基本用法
整行宽度
+获取打开状态
自定义
## API
@@ -30,7 +31,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_iwk9zp/afts/img/A*cahuSJ4VxvoAAA
| 属性 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| block | 是否整行宽度 | boolean | false | - |
-| children | 自定义输入框 | ({ onTrigger, onKeyDown }) => ReactElement | - | - |
+| children | 自定义输入框 | ({ onTrigger, onKeyDown, open }) => ReactElement | - | - |
| items | 建议项列表 | SuggestionItem[] \| ((info: T) => SuggestionItem[]) | - | - |
| open | 受控打开面板 | boolean | - | - |
| rootClassName | 根元素样式类名 | string | - | - |
diff --git a/components/use-x-agent/__tests__/__snapshots__/demo.test.ts.snap b/components/use-x-agent/__tests__/__snapshots__/demo.test.ts.snap
index 38d5cf149..36ec0bc7b 100644
--- a/components/use-x-agent/__tests__/__snapshots__/demo.test.ts.snap
+++ b/components/use-x-agent/__tests__/__snapshots__/demo.test.ts.snap
@@ -7,7 +7,7 @@ Array [
class="ant-form ant-form-vertical"
>