Skip to content

Commit

Permalink
fix: 自定义tooltip改回绝对定位
Browse files Browse the repository at this point in the history
  • Loading branch information
lucy-cl committed Jan 31, 2024
1 parent ac1ef60 commit f6ca756
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/aop/controller/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class WidgetsTooltipController extends RawTooltipController {
if (!this.tooltipContainer) {
const container = document.createElement('div');
container.className = `${FullCrossName} widgets-tooltip`;
container.style.cssText = `position: fixed;z-index: 1001; pointer-events: none; transition: left 0.1s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.1s cubic-bezier(0.23, 1, 0.32, 1) 0s;`;
container.style.cssText = `position: absolute;z-index: 1001; pointer-events: none; transition: left 0.1s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.1s cubic-bezier(0.23, 1, 0.32, 1) 0s;`;

document.body.append(container);

Expand Down
2 changes: 1 addition & 1 deletion src/common/Tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const WidgetsTooltip = forwardRef(({ content, offset }: WidgetsTooltipProps, ref
<div
className={`${FullCrossName} ${prefix}-container`}
style={{
position: 'fixed',
position: 'absolute',
top: pos.y + (offset?.y || 0),
left: pos.x + ref.current?.offsetWidth / 2 + (offset?.x || 0),
}}
Expand Down

0 comments on commit f6ca756

Please sign in to comment.