From 4bc4a0bec721c0c44c19642bc8f066564585c0ec Mon Sep 17 00:00:00 2001 From: zhaijunlei <276318515@qq.com> Date: Thu, 25 Jun 2026 18:29:21 +0800 Subject: [PATCH 1/2] fix(DockView): restore a re-shown group's size only when it collapsed to its minimum --- .../wwwroot/js/dockview-group.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-group.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-group.js index 8b2af8d6..465db180 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-group.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-group.js @@ -85,10 +85,15 @@ const addPanelWidthGroupId = (dockview, panel, index) => { } } - // Placeholder branch collapsed to width 0 in the saved layout; restore the pre-delete width (currentPosition) - // via initialWidth → setSize, else it re-shows at min ~100. - const restoreWidth = reusedEmptyGroup && group.api.location.type === 'grid' - ? panel.params?.currentPosition?.width : undefined; + // Restore a saved dimension only when the group collapsed to its minimum; if the structure already gave it a real + // size, restoring a stale saved value would shrink it and squeeze/blank a sibling. + let initialWidth, initialHeight; + if (reusedEmptyGroup && group.api.location.type === 'grid' && group.element.parentElement) { + const cp = panel.params?.currentPosition; + const { offsetWidth, offsetHeight } = group.element.parentElement; + if (cp?.width > offsetWidth && offsetWidth <= group.minimumWidth + 2) initialWidth = cp.width; + if (cp?.height > offsetHeight && offsetHeight <= group.minimumHeight + 2) initialHeight = cp.height; + } dockview.addPanel({ id: panel.id, title: panel.title, @@ -96,7 +101,8 @@ const addPanelWidthGroupId = (dockview, panel, index) => { renderer: panel.renderer, component: panel.component, position: { referenceGroup: group, index: index || 0 }, - initialWidth: restoreWidth > 0 ? restoreWidth : undefined, + initialWidth, + initialHeight, params: { ...panel.params, rect, packup, visible: true } }) @@ -108,8 +114,8 @@ const addPanelWidthGroupId = (dockview, panel, index) => { // Placeholder deferred its action states while empty (see resetActionStates); re-render now it has a panel. if (reusedEmptyGroup && group.api.location.type === 'grid') { reRenderActionStates(group); - // initialWidth left a _pendingSize; clear it so a later setVisible(true) (float->dock) won't replay this stale width. - if (restoreWidth > 0) group.api._pendingSize = undefined; + // The restore left a _pendingSize; clear it so a later setVisible(true) (float->dock) won't replay this stale size. + if (initialWidth > 0 || initialHeight > 0) group.api._pendingSize = undefined; } } From ed07fc7d6f9222f08c6aa4533717321eaefaf867 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 26 Jun 2026 11:46:18 +0800 Subject: [PATCH 2/2] chore(DockView): bump version 10.0.22 --- .../BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj index c33c8b8b..183af799 100644 --- a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj +++ b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj @@ -1,7 +1,7 @@  - 10.0.21 + 10.0.22