diff --git a/packages/amis-core/src/components/Overlay.tsx b/packages/amis-core/src/components/Overlay.tsx index 50a5d559d..9dc16cc82 100644 --- a/packages/amis-core/src/components/Overlay.tsx +++ b/packages/amis-core/src/components/Overlay.tsx @@ -82,14 +82,14 @@ class Position extends React.Component { } if (!target || !target.offsetWidth) { - return; - // return this.setState({ - // ready: false, - // positionLeft: 0, - // positionTop: 0, - // arrowOffsetLeft: null, - // arrowOffsetTop: null - // }); + // 靠这个 re-render 来重置 position + return this.setState({ + ready: false, + positionLeft: 0, + positionTop: 0, + arrowOffsetLeft: null, + arrowOffsetTop: null + }); } const watchTargetSizeChange = this.props.watchTargetSizeChange;