From 45fce0e3721f51f457673e19fdef6902730b362b Mon Sep 17 00:00:00 2001 From: zhaijunlei <276318515@qq.com> Date: Tue, 23 Jun 2026 17:55:55 +0800 Subject: [PATCH 1/3] fix(DockView): keep active panel on becoming visible; only re-pick the tab on a real shrink --- .../wwwroot/js/dockview-utils.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js index 8a17bdcd..c570c1f3 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js @@ -201,8 +201,21 @@ const setWidth = (target, dockview) => { let dropdown = header.querySelector('.dv-right-actions-container>.dropdown') if (!dropdown) return let dropMenu = dropdown.querySelector('.dropdown-menu') + // `shrinking` (a strict width drop) gates the active-panel switch below — it must NOT fire during the + // transient expand a group goes through when a hidden view becomes visible (would switch + blank it). + const group = dockview.params.inited ? dockview.groups.find(g => g.element === header.parentElement) : null + const shrinking = group && group._lastHeaderWidth !== undefined && header.offsetWidth < group._lastHeaderWidth + if (group) group._lastHeaderWidth = header.offsetWidth + if (voidWidth === 0) { if (tabsContainer.children.length <= 1) return + // On shrink, if the active tab would overflow, switch to the first panel before tucking it away. + if (shrinking) { + const activeTab = tabsContainer.querySelector('.dv-tab.dv-active-tab') + if (activeTab && activeTab.offsetLeft + activeTab.offsetWidth > tabsContainer.offsetWidth) { + group.panels[0]?.api.setActive() + } + } const tabs = tabsContainer.querySelectorAll('.dv-tab') for (let i = tabs.length - 1; i >= 0; i--) { const lastTab = tabs[i] @@ -227,9 +240,9 @@ const setWidth = (target, dockview) => { } } } - if (dockview.params.inited && [...tabsContainer.children].every(tab => tab.classList.contains('dv-inactive-tab'))) { - const group = dockview.groups.find(g => g.element === header.parentElement) - group.panels[0] && group.panels[0].api.setActive() + // Fallback: keep an active panel when the group has none (e.g. the active one was closed). + if (group && !group.activePanel) { + group.panels[0]?.api.setActive() } } From 6a109fd8945a05cae65f589c4b0669de431bc275 Mon Sep 17 00:00:00 2001 From: zhaijunlei <276318515@qq.com> Date: Tue, 23 Jun 2026 19:25:23 +0800 Subject: [PATCH 2/3] fix(DockView): stop sibling blanking on any exit-maximize (remove/move/add/hide a group) --- .../wwwroot/js/dockview-utils.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js index c570c1f3..de4bad1a 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js @@ -21,10 +21,30 @@ const cerateDockview = (el, options) => { createComponent: option => new DockviewPanelContent(option) }); guardCollapsedSaveProportions(dockview); + guardMaximizeExit(dockview); initDockview(dockview, options, template); return dockview; } +// Carry the `maximizing` flag on EVERY exit-maximize, not just the toggle button: the core also exits +// maximize when a group is removed/hidden/moved/added, and without the flag the restored siblings blank. +const guardMaximizeExit = dockview => { + const gridview = dockview.gridview; + if (!gridview) return; + const proto = Object.getPrototypeOf(gridview); + if (proto.__bbMaximizeExitGuard) return; + proto.__bbMaximizeExitGuard = true; + const original = proto.exitMaximizedView; + proto.exitMaximizedView = function () { + const dv = this._maximizedNode?.leaf?.view?.api?.accessor; + if (!dv) return original.call(this); + const prev = dv.params.maximizing; + dv.params.maximizing = true; + try { return original.call(this); } + finally { dv.params.maximizing = prev; } + }; +} + // Fix "groups evenly split after refresh": while collapsed (size 0) skip overwriting existing // proportions, else saveProportions freezes the collapsed equal-minimums as the split. _proportions is // undefined only on the first deserialize save — let that through. Upstream fix: add `size > 0` to From 20d8e06f5c5d7db094e845c0cb4b2fd8894d915f Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 24 Jun 2026 08:39:24 +0800 Subject: [PATCH 3/3] chore: bump version 10.0.20 --- .../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 06e79258..c829f4da 100644 --- a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj +++ b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj @@ -1,7 +1,7 @@  - 10.0.19 + 10.0.20