diff --git a/packages/components/src/components/select/Select.tsx b/packages/components/src/components/select/Select.tsx index 3aa517e0b6..b5b620ed8c 100644 --- a/packages/components/src/components/select/Select.tsx +++ b/packages/components/src/components/select/Select.tsx @@ -55,6 +55,7 @@ const Select: React.FC = (props: SelectProps) => { listHeight, listRowHeight = defaultListRowHeight, width, + getContainer, } = props; const { getPrefixCls } = useContext(ConfigContext); const prefix = getPrefixCls('select', customizePrefixCls); @@ -269,6 +270,7 @@ const Select: React.FC = (props: SelectProps) => { placement="bottomLeft" overlay={list} overlayClassName={`${prefix}-dropdown`} + getTooltipContainer={getContainer} > {trigger} diff --git a/packages/components/src/components/select/interface.ts b/packages/components/src/components/select/interface.ts index 51b9daa9cf..a5d950d5d2 100644 --- a/packages/components/src/components/select/interface.ts +++ b/packages/components/src/components/select/interface.ts @@ -15,6 +15,7 @@ export interface SelectProps { width?: number; listHeight?: number; listRowHeight?: number; + getContainer?: (node: HTMLElement) => HTMLElement; } export { Option }; diff --git a/packages/website/src/components/basic/tooltip/index.zh-CN.md b/packages/website/src/components/basic/tooltip/index.zh-CN.md index 25e1917171..619a9742c4 100644 --- a/packages/website/src/components/basic/tooltip/index.zh-CN.md +++ b/packages/website/src/components/basic/tooltip/index.zh-CN.md @@ -31,7 +31,7 @@ group: | 参数 | 说明 | 类型 | 默认值 | | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | --------------------- | -| **getPopupContainer** | 浮层渲染父节点,默认渲染到 body 上 | function(triggerNode) | `() => document.body` | +| **getTooltipContainer** | 浮层渲染父节点,默认渲染到 body 上 | function(triggerNode) | `() => document.body` | | **overlayClassName** | 添加 className | string | `''` | | **placement** | 气泡框位置, 可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | `'top'` | | **trigger** | 触发行为,可选 hover,focus,click,contextMenu | string\|string[] | `hover` | diff --git a/packages/website/src/components/functional/select/index.zh-CN.md b/packages/website/src/components/functional/select/index.zh-CN.md index 514c148ad0..e56cd7b195 100644 --- a/packages/website/src/components/functional/select/index.zh-CN.md +++ b/packages/website/src/components/functional/select/index.zh-CN.md @@ -25,14 +25,15 @@ group: ## 参数说明 -| 参数 | 说明 | 类型 | 默认值 | -| ------------- | --------------------------------------------------- | ------------------------------------------------------------------------- | -------- | -| size | select 的大小 | `small` , `medium` , `large` | `medium` | -| options | 同 list Options | `Options[]` | - | -| multiple | 多选 | `boolean` | `false` | -| searchable | 是否可搜索 | `boolean` | `false` | -| onChange | 选择的回调 | `(options: Option[] or Option) => void` | | -| width | select 的宽度 | `number` | - | -| labelRenderer | list Item 的自定义渲染方法, 传入会取消搜索高亮功能 | `(input:string) => (option: Option, isGroup: boolean) => React.ReactNode` | - | -| listHeight | list 高度, 传入会取消 list 动态高度功能 | `number` | - | -| listRowHeight | list item 的高度 | `number` | 44 | +| 参数 | 说明 | 类型 | 默认值 | +| ------------- | --------------------------------------------------- | ------------------------------------------------------------------------- | --------------------- | +| size | select 的大小 | `small` , `medium` , `large` | `medium` | +| options | 同 list Options | `Options[]` | - | +| multiple | 多选 | `boolean` | `false` | +| searchable | 是否可搜索 | `boolean` | `false` | +| onChange | 选择的回调 | `(options: Option[] or Option) => void` | | +| width | select 的宽度 | `number` | - | +| labelRenderer | list Item 的自定义渲染方法, 传入会取消搜索高亮功能 | `(input:string) => (option: Option, isGroup: boolean) => React.ReactNode` | - | +| listHeight | list 高度, 传入会取消 list 动态高度功能 | `number` | - | +| listRowHeight | list item 的高度 | `number` | 44 | +| getContainer | 浮层渲染父节点,默认渲染到 body 上 | function(triggerNode) | `() => document.body` |