mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
chore: code style improve for tooltip (#52543)
This commit is contained in:
parent
860d7b084a
commit
42a7e5dc2e
@ -150,6 +150,17 @@ const InternalTooltip = React.forwardRef<TooltipRef, TooltipProps>((props, ref)
|
||||
builtinPlacements,
|
||||
arrowPointAtCenter = false,
|
||||
autoAdjustOverflow = true,
|
||||
motion,
|
||||
getPopupContainer,
|
||||
placement = 'top',
|
||||
mouseEnterDelay = 0.1,
|
||||
mouseLeaveDelay = 0.1,
|
||||
overlayStyle,
|
||||
rootClassName,
|
||||
overlayClassName,
|
||||
styles,
|
||||
classNames: tooltipClassNames,
|
||||
...restProps
|
||||
} = props;
|
||||
|
||||
const mergedShowArrow = !!arrow;
|
||||
@ -257,19 +268,6 @@ const InternalTooltip = React.forwardRef<TooltipRef, TooltipProps>((props, ref)
|
||||
</ContextIsolator>
|
||||
);
|
||||
|
||||
const {
|
||||
getPopupContainer,
|
||||
placement = 'top',
|
||||
mouseEnterDelay = 0.1,
|
||||
mouseLeaveDelay = 0.1,
|
||||
overlayStyle,
|
||||
rootClassName,
|
||||
overlayClassName,
|
||||
styles,
|
||||
classNames: tooltipClassNames,
|
||||
...otherProps
|
||||
} = props;
|
||||
|
||||
const prefixCls = getPrefixCls('tooltip', customizePrefixCls);
|
||||
const rootPrefixCls = getPrefixCls();
|
||||
|
||||
@ -314,11 +312,11 @@ const InternalTooltip = React.forwardRef<TooltipRef, TooltipProps>((props, ref)
|
||||
const bodyClassNames = classNames(tooltip?.classNames?.body, tooltipClassNames?.body);
|
||||
|
||||
// ============================ zIndex ============================
|
||||
const [zIndex, contextZIndex] = useZIndex('Tooltip', otherProps.zIndex);
|
||||
const [zIndex, contextZIndex] = useZIndex('Tooltip', restProps.zIndex);
|
||||
|
||||
const content = (
|
||||
<RcTooltip
|
||||
{...otherProps}
|
||||
{...restProps}
|
||||
zIndex={zIndex}
|
||||
showArrow={mergedShowArrow}
|
||||
placement={placement}
|
||||
|
Loading…
Reference in New Issue
Block a user