fix: plugin custom inspector tab hidden by display:none

In TabMgr.render(), the container div's className (including
util.getHide(hideAll)) was evaluated before props.tabs.map() ran.
Since hideAll was still its initial value true at that point, the
container always carried the 'hide' class (display:none), making all
plugin custom inspector tabs (declared via whistleConfig.inspectorsTab)
render but remain invisible.

Evaluate getHide() after the map() callback has corrected hideAll,
restoring the 2.10.7 semantics.
This commit is contained in:
zhuzhenting
2026-08-18 14:50:03 +08:00
committed by avenwu
parent 8d9ee8f5f3
commit c786cfb8d7
+18 -17
View File
@@ -57,6 +57,23 @@ var TabMgr = React.createClass({
var hide = props.hide;
var active = props.active;
var hideAll = true;
var tabs = props.tabs.map(function (tab) {
var plugin = tab.plugin;
var hideTab = hide || active !== plugin;
if (!hideTab) {
hideAll = false;
}
return (
self.isInited(tab) && (
<TabFrame
ref={plugin}
key={plugin}
src={tab.action}
hide={hideTab}
/>
)
);
});
return (
<div
className={
@@ -65,23 +82,7 @@ var TabMgr = React.createClass({
util.getHide(hideAll)
}
>
{props.tabs.map(function (tab) {
var plugin = tab.plugin;
var hideTab = hide || active !== plugin;
if (!hideTab) {
hideAll = false;
}
return (
self.isInited(tab) && (
<TabFrame
ref={plugin}
key={plugin}
src={tab.action}
hide={hideTab}
/>
)
);
})}
{tabs}
</div>
);
}