Skip to content

Commit c0ef91f

Browse files
authored
fix(Guide): cannot read property 'style' of null (#4027)
1 parent 1f37244 commit c0ef91f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/components/guide/Guide.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ const Guide: React.FC<GuideProps> = (originalProps) => {
6565

6666
// 设置高亮层的位置
6767
const setHighlightLayerPosition = (highlightLayer: HTMLElement) => {
68+
if (!highlightLayer) return; // 避免在 setTimeout 中访问时,可能元素已经被摧毁
69+
6870
let { top, left } = getRelativePosition(currentHighlightLayerElm.current);
6971
let { width, height } = currentHighlightLayerElm.current.getBoundingClientRect();
7072
const highlightPadding = getCurrentCrossProps('highlightPadding');

0 commit comments

Comments
 (0)