Browse Source

fix(gui-v2): wrong sort position when pulled to first pos

pull/2837/head
braks 2 years ago
parent
commit
497634a043
  1. 2
      packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue

2
packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue

@ -89,7 +89,7 @@ function initializeSortable(el: HTMLElement) {
if (views.value.length - 1 === newIndex) {
nextOrder = parseFloat(previousItem.order) + 1
} else if (newIndex === 0) {
nextOrder = parseFloat(previousItem.order) / 2
nextOrder = (parseFloat(nextItem.order) > 1 ? parseFloat(nextItem.order) - 1 : parseFloat(nextItem.order) / 2) || 0
} else {
nextOrder = (parseFloat(previousItem.order) + parseFloat(nextItem.order)) / 2
}

Loading…
Cancel
Save