Skip to content

Commit 95a1137

Browse files
authored
fix: fix tooltip being covered by other elements (alibaba#1717)
* docs: fix incorrect content for emit method in event api * fix: Fix tooltip being covered by other elements
1 parent 4d4a8a6 commit 95a1137

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

packages/editor-core/src/widgets/tip/tip-container.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import { TipItem } from './tip-item';
33
import { tipHandler } from './tip-handler';
44

55
export class TipContainer extends Component {
6+
private dispose?: () => void;
67
shouldComponentUpdate() {
78
return false;
89
}
9-
10-
private dispose?: () => void;
11-
1210
componentDidMount() {
1311
const over = (e: MouseEvent) => tipHandler.setTarget(e.target as any);
1412
const down = () => tipHandler.hideImmediately();
@@ -27,10 +25,11 @@ export class TipContainer extends Component {
2725
}
2826

2927
render() {
30-
return (
28+
return window.ReactDOM.createPortal(
3129
<div className="lc-tips-container">
3230
<TipItem />
33-
</div>
31+
</div>,
32+
document.querySelector('body')!,
3433
);
3534
}
3635
}

0 commit comments

Comments
 (0)