Browse Source
fix(Tooltip): the mistake that tooltip mount on wrong dom (#30963)
when getPopupContainer of tooltip's props is undefined or null
pull/30970/head
gaozhenqian
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
2 deletions
-
components/tooltip/index.tsx
|
|
@ -202,10 +202,11 @@ const Tooltip = React.forwardRef<unknown, TooltipProps>((props, ref) => { |
|
|
|
return overlay || title || ''; |
|
|
|
}; |
|
|
|
|
|
|
|
const { getPopupContainer, ...otherProps } = props; |
|
|
|
|
|
|
|
const { |
|
|
|
prefixCls: customizePrefixCls, |
|
|
|
openClassName, |
|
|
|
getPopupContainer, |
|
|
|
getTooltipContainer, |
|
|
|
overlayClassName, |
|
|
|
color, |
|
|
@ -244,7 +245,7 @@ const Tooltip = React.forwardRef<unknown, TooltipProps>((props, ref) => { |
|
|
|
|
|
|
|
return ( |
|
|
|
<RcTooltip |
|
|
|
{...props} |
|
|
|
{...otherProps} |
|
|
|
prefixCls={prefixCls} |
|
|
|
overlayClassName={customOverlayClassName} |
|
|
|
getTooltipContainer={getPopupContainer || getTooltipContainer || getContextPopupContainer} |
|
|
|