File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
packages/applet/src/modules/components Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -400,14 +400,11 @@ function getNearestPreviousNode(parentId: string) {
400
400
401
401
function getNearestNextNode() {
402
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
403
+ const activeItemListIndex = [... linkedListTree ].findLastIndex (arr => arr ?.includes (activeComponentId .value ))
408
404
409
405
if (activeItemListIndex === - 1 )
410
406
return activeComponentId .value
407
+
411
408
const arr1 = linkedListTree [activeItemListIndex ]
412
409
const arr2 = linkedListTree [activeItemListIndex + 1 ]
413
410
You can’t perform that action at this time.
0 commit comments