We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48db6b0 commit 717d5c5Copy full SHA for 717d5c5
packages/applet/src/modules/components/index.vue
@@ -400,14 +400,11 @@ function getNearestPreviousNode(parentId: string) {
400
401
function getNearestNextNode() {
402
const linkedListTree = treeNodeLinkedList.value
403
- const activeItemListIndex = [...linkedListTree]
404
- .map((arr, index) => ({ arr, index }))
405
- .reverse()
406
- .find(({ arr }) => arr?.includes(activeComponentId.value))
407
- ?.index as number
+ const activeItemListIndex = [...linkedListTree].findLastIndex(arr => arr?.includes(activeComponentId.value))
408
409
if (activeItemListIndex === -1)
410
return activeComponentId.value
+
411
const arr1 = linkedListTree[activeItemListIndex]
412
const arr2 = linkedListTree[activeItemListIndex + 1]
413
0 commit comments