refactor(expandParent): use current value on drag #5039
This commit is contained in:
@@ -154,7 +154,9 @@ const createStore = ({
|
|||||||
const changes = [];
|
const changes = [];
|
||||||
|
|
||||||
for (const [id, dragItem] of nodeDragItems) {
|
for (const [id, dragItem] of nodeDragItems) {
|
||||||
const expandParent = !!(dragItem?.expandParent && dragItem?.parentId && dragItem?.position);
|
// we are using the nodelookup to be sure to use the current expandParent and parentId value
|
||||||
|
const node = get().nodeLookup.get(id);
|
||||||
|
const expandParent = !!(node?.expandParent && node?.parentId && dragItem?.position);
|
||||||
|
|
||||||
const change: NodeChange = {
|
const change: NodeChange = {
|
||||||
id,
|
id,
|
||||||
@@ -171,7 +173,7 @@ const createStore = ({
|
|||||||
if (expandParent) {
|
if (expandParent) {
|
||||||
parentExpandChildren.push({
|
parentExpandChildren.push({
|
||||||
id,
|
id,
|
||||||
parentId: dragItem.parentId!,
|
parentId: node.parentId!,
|
||||||
rect: {
|
rect: {
|
||||||
...dragItem.internals.positionAbsolute,
|
...dragItem.internals.positionAbsolute,
|
||||||
width: dragItem.measured.width!,
|
width: dragItem.measured.width!,
|
||||||
|
|||||||
Reference in New Issue
Block a user