Closed qsantos closed 7 months ago
To reproduce:
Comment C is still collapsed, as expected. However, rhe children of comment C are visible. They should not be since comment C is collapsed.
https://news.ycombinator.com/item?id=39498281#39515468 can be used as “comment C”
The bug was introduced on 2021-09-02:
Example
In the screenshot above, the highlighted comment by letmeinhere
is collapsed, but its child by AYoung010
is visible.
Corresponding patch for Hacker News:
diff --git a/hn.js b/hn.js
index 946eda9..a1ae174 100644
--- a/hn.js
+++ b/hn.js
@@ -59,11 +59,10 @@ function kidvis (tr, show) {
break;
} else if (!show) {
setshow(tr, false);
- } else if (ind(tr) == n) {
+ } else if (!coll || ind(tr) <= n) {
+ n = ind(tr);
coll = hasClass(tr, 'coll');
setshow(tr, true);
- } else if (!coll) {
- setshow(tr, true);
}
}
}
This is actually a bug of Hacker News, but should be addressed by ViHN