mirror of
https://github.com/penpot/penpot.git
synced 2026-08-17 10:18:59 +00:00
🐛 Expand folded combos that gain changed elements
setData merges datum props by id on a live G6 instance, so omitting style.collapsed retained a previous true: with "fold unchanged" on, a change inside a folded combo pulsed but never expanded it. Write the boolean explicitly both ways. Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>
This commit is contained in:
parent
b6d34a0a97
commit
661eeb7dfd
@ -703,7 +703,11 @@ Graph Console
|
|||||||
const combo = { id: comboIdFor(n.id), data: { label: n.label, table: n.table } };
|
const combo = { id: comboIdFor(n.id), data: { label: n.label, table: n.table } };
|
||||||
const p = parentOf[n.id];
|
const p = parentOf[n.id];
|
||||||
if (p && hasCombo[p]) combo.combo = comboIdFor(p);
|
if (p && hasCombo[p]) combo.combo = comboIdFor(p);
|
||||||
if (collapsedIds && collapsedIds.has(combo.id)) combo.style = { collapsed: true };
|
// Explicit boolean both ways: setData merges datum props by id on a
|
||||||
|
// live instance, so omitting `collapsed` would retain a previous
|
||||||
|
// `true` — a change inside a folded combo could then never expand it
|
||||||
|
// (the fold-unchanged bug).
|
||||||
|
combo.style = { collapsed: !!(collapsedIds && collapsedIds.has(combo.id)) };
|
||||||
combos.push(combo);
|
combos.push(combo);
|
||||||
});
|
});
|
||||||
const g6nodes = nodes.map(function (n) {
|
const g6nodes = nodes.map(function (n) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user