From 3caad342adcf8addea0094539a84da993e718eed Mon Sep 17 00:00:00 2001 From: pubuzhixing8 Date: Sat, 15 Mar 2025 17:29:49 +0800 Subject: [PATCH] feat(component): fit viewport after children updated (#104) --- packages/react-board/src/wrapper.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-board/src/wrapper.tsx b/packages/react-board/src/wrapper.tsx index adf4a95d..72c07b01 100644 --- a/packages/react-board/src/wrapper.tsx +++ b/packages/react-board/src/wrapper.tsx @@ -28,6 +28,7 @@ import { withI18n, updateViewBox, FLUSHING, + BoardTransforms, } from '@plait/core'; import { BoardChangeData } from './plugins/board'; import { useCallback, useEffect, useRef, useState } from 'react'; @@ -198,6 +199,7 @@ export const Wrapper: React.FC = ({ parent: board, parentG: PlaitBoard.getElementHost(board), }); + BoardTransforms.fitViewport(board); } }, [value]);