From 95a1137b466b73d7dabe9a453e2016bd0c51322c Mon Sep 17 00:00:00 2001 From: beautiful-boyyy <66351806+beautiful-boyyy@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:14:24 +0800 Subject: [PATCH] fix: fix tooltip being covered by other elements (#1717) * docs: fix incorrect content for emit method in event api * fix: Fix tooltip being covered by other elements --- packages/editor-core/src/widgets/tip/tip-container.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/editor-core/src/widgets/tip/tip-container.tsx b/packages/editor-core/src/widgets/tip/tip-container.tsx index 81750bd6a..ae494d540 100644 --- a/packages/editor-core/src/widgets/tip/tip-container.tsx +++ b/packages/editor-core/src/widgets/tip/tip-container.tsx @@ -3,12 +3,10 @@ import { TipItem } from './tip-item'; import { tipHandler } from './tip-handler'; export class TipContainer extends Component { + private dispose?: () => void; shouldComponentUpdate() { return false; } - - private dispose?: () => void; - componentDidMount() { const over = (e: MouseEvent) => tipHandler.setTarget(e.target as any); const down = () => tipHandler.hideImmediately(); @@ -27,10 +25,11 @@ export class TipContainer extends Component { } render() { - return ( + return window.ReactDOM.createPortal(
-
+ , + document.querySelector('body')!, ); } }