diff --git a/packages/nc-gui-v2/components/dashboard/TreeView.vue b/packages/nc-gui-v2/components/dashboard/TreeView.vue index 55cc4bd111..9c040b6ce1 100644 --- a/packages/nc-gui-v2/components/dashboard/TreeView.vue +++ b/packages/nc-gui-v2/components/dashboard/TreeView.vue @@ -58,6 +58,9 @@ const initSortable = (el: Element) => { // get the html collection of all list items const children: HTMLCollection = evt.to.children + // skip if children count is 1 + if (children.length < 2) return + // get items before and after the moved item const itemBeforeEl = children[newIndex - 1] as HTMLLIElement const itemAfterEl = children[newIndex + 1] as HTMLLIElement