dsh-multipane 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +26 -2
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -3402,6 +3402,23 @@ window.__ModuleLoader__.load({
|
|
|
3402
3402
|
}
|
|
3403
3403
|
}
|
|
3404
3404
|
};
|
|
3405
|
+
/**
|
|
3406
|
+
* 栏里是否存在「我们没搬走的那一行」。
|
|
3407
|
+
*
|
|
3408
|
+
* 有 = 宿主又重建了一份统计行(旧节点被 React 抛弃)。这一步必须放在
|
|
3409
|
+
* hideStrayRows 之前判断,因为 hide 会给它打 display:none,但它仍是活节点。
|
|
3410
|
+
*/
|
|
3411
|
+
const findFreshRow = (host) => {
|
|
3412
|
+
for (const pane of Array.from(document.querySelectorAll(".dsv-pane"))) {
|
|
3413
|
+
for (const dock of Array.from(pane.querySelectorAll(".cm-stat-dock"))) {
|
|
3414
|
+
const row = dock.parentElement?.parentElement ?? null;
|
|
3415
|
+
if (row === null || host.contains(row)) continue;
|
|
3416
|
+
if (moved !== null && row === moved.node) continue;
|
|
3417
|
+
return row;
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
return null;
|
|
3421
|
+
};
|
|
3405
3422
|
|
|
3406
3423
|
const scan = () => {
|
|
3407
3424
|
if (disposed) return;
|
|
@@ -3415,8 +3432,15 @@ window.__ModuleLoader__.load({
|
|
|
3415
3432
|
一份在底栏(y≈796)。用户看到的就是「底栏数据和栏内数据重复显示」。
|
|
3416
3433
|
旧代码在 holds() 时直接 return,漏掉了这一步隐藏。 */
|
|
3417
3434
|
if (holds()) {
|
|
3418
|
-
|
|
3419
|
-
|
|
3435
|
+
/* 手里这份还挂着,**不代表它还活着**:宿主每次重渲染都会新建一行、
|
|
3436
|
+
把旧节点抛弃(React 不再管它),而旧节点的 isConnected / parentNode
|
|
3437
|
+
全部照旧成立 → holds() 恒为真,于是我们永远握着一个死节点,
|
|
3438
|
+
底栏那些按钮点了没反应(onClick 还在 fiber 上,但组件已不参与渲染)。
|
|
3439
|
+
判据:栏里只要又出现了一行(容器外的),就一定是宿主新建的 → 换掉它。 */
|
|
3440
|
+
if (findFreshRow(host) === null) {
|
|
3441
|
+
hideStrayRows(host);
|
|
3442
|
+
return;
|
|
3443
|
+
}
|
|
3420
3444
|
}
|
|
3421
3445
|
// The host re-rendered and swapped the row out from under us: forget
|
|
3422
3446
|
// the stale node and pick the fresh one up below.
|
package/package.json
CHANGED