瀏覽代碼

[cdb] Fix duplicate columns when expanding nested separators

Clément Espeute 11 月之前
父節點
當前提交
ea0ec7b807
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      hide/comp/cdb/Table.hx

+ 9 - 1
hide/comp/cdb/Table.hx

@@ -399,10 +399,18 @@ class Table extends Component {
 			return;
 		var subs = element.find("tr.separator");
 		var t = makeSeparatorTree(sheet.separators[sepIndex]);
+
+		// We need to open the separators starting from the first parent, else the columns get duplicated
+		var reverseParentList = [];
+
 		while( t.parent != null ) {
+			reverseParentList.unshift(t);
+			t = t.parent;
+		}
+
+		for (t in reverseParentList) {
 			if( isSepHidden(t.index) )
 				new Element(subs.get(t.index)).find("a.toggle").click();
-			t = t.parent;
 		}
 	}