Skip to content

Commit

Permalink
fix(reorder-group): synchronize reordering with style update
Browse files Browse the repository at this point in the history
closes #21182
  • Loading branch information
dan-rp1 committed Jul 21, 2022
1 parent ab65e9a commit ca606af
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 19 deletions.
36 changes: 24 additions & 12 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions core/src/components/reorder-group/reorder-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,16 @@ export class ReorderGroup implements ComponentInterface {
this.el.insertBefore(selectedItemEl, ref);
}

if (Array.isArray(listOrReorder)) {
listOrReorder = reorderArray(listOrReorder, fromIndex, toIndex);
}

for (let i = 0; i < len; i++) {
children[i].style['transform'] = '';
}
// setTimeout forces the style update to synchronize with the reordering.
setTimeout(() => {
if (Array.isArray(listOrReorder)) {
listOrReorder = reorderArray(listOrReorder, fromIndex, toIndex);
}

for (let i = 0; i < len; i++) {
children[i].style['transform'] = '';
}
});

selectedItemEl.style.transition = '';
selectedItemEl.classList.remove(ITEM_REORDER_SELECTED);
Expand Down

0 comments on commit ca606af

Please sign in to comment.