Skip to content

Commit

Permalink
fix(design): MouseTooltip should inherit Tooltip className
Browse files Browse the repository at this point in the history
  • Loading branch information
dengfuping committed Nov 20, 2024
1 parent 695de5b commit fdc78e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/design/src/tooltip/demo/mouse-follow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const App: React.FC = () => {
</Col>
<Col span={12}>
<Tooltip
title="This is prompt text. This is prompt text. This is prompt text. This is prompt text."
title="This is prompt text. This is prompt text. This is prompt text. This is prompt text. This is prompt text."
type={type}
mouseFollow={true}
>
Expand Down
5 changes: 3 additions & 2 deletions packages/design/src/tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ const Tooltip = React.forwardRef<TooltipRef, TooltipProps>(
const prefixCls = getPrefixCls('tooltip', customizePrefixCls);
const { wrapSSR, hashId } = useStyle(prefixCls);

const tooltipCls = classNames(className, hashId);
const tooltipCls = classNames(className);
const mouseTooltipCls = classNames(prefixCls, className, hashId);
const [innerOpen, setInnerOpen] = useState(open ?? visible ?? defaultOpen ?? defaultVisible);

// 同步 ant-design noTitle 逻辑
Expand Down Expand Up @@ -108,7 +109,7 @@ const Tooltip = React.forwardRef<TooltipRef, TooltipProps>(
color: typeItem?.color,
...overlayInnerStyle,
}}
className={tooltipCls}
className={mouseTooltipCls}
overlay={overlay}
{...restProps}
>
Expand Down

0 comments on commit fdc78e8

Please sign in to comment.