mirror of
https://github.com/mathuo/dockview
synced 2025-09-10 11:26:24 +00:00
feat: init react views with container size
This commit is contained in:
parent
cea4dcffc0
commit
0533073e1d
@ -137,6 +137,9 @@ export const DockviewReact = React.forwardRef(
|
||||
domRef.current?.appendChild(dockview.element);
|
||||
dockview.deserializer = new ReactPanelDeserialzier(dockview);
|
||||
|
||||
const { clientWidth, clientHeight } = domRef.current!;
|
||||
dockview.layout(clientWidth, clientHeight);
|
||||
|
||||
if (props.onReady) {
|
||||
props.onReady({ api: new DockviewApi(dockview) });
|
||||
}
|
||||
|
@ -82,6 +82,9 @@ export const GridviewReact = React.forwardRef(
|
||||
|
||||
domRef.current?.appendChild(gridview.element);
|
||||
|
||||
const { clientWidth, clientHeight } = domRef.current!;
|
||||
gridview.layout(clientWidth, clientHeight);
|
||||
|
||||
if (props.onReady) {
|
||||
props.onReady({ api: new GridviewApi(gridview) });
|
||||
}
|
||||
|
@ -79,6 +79,9 @@ export const PaneviewReact = React.forwardRef(
|
||||
},
|
||||
});
|
||||
|
||||
const { clientWidth, clientHeight } = domRef.current!;
|
||||
paneview.layout(clientWidth, clientHeight);
|
||||
|
||||
if (props.onReady) {
|
||||
props.onReady({ api: new PaneviewApi(paneview) });
|
||||
}
|
||||
|
@ -77,6 +77,9 @@ export const SplitviewReact = React.forwardRef(
|
||||
: undefined,
|
||||
});
|
||||
|
||||
const { clientWidth, clientHeight } = domRef.current!;
|
||||
splitview.layout(clientWidth, clientHeight);
|
||||
|
||||
if (props.onReady) {
|
||||
props.onReady({ api: new SplitviewApi(splitview) });
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user