Skip to content

Commit 4ed7f68

Browse files
authored
try this
1 parent 00a6c0a commit 4ed7f68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/addons/addons/reorder-custom-inputs/userscript.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,16 @@ export default async function ({ addon, console }) {
100100

101101
const original = procedureBlock.inputList.find((input) => input.name === inputNameToShift);
102102
const originalPosition = procedureBlock.inputList.findIndex((input) => input.name === inputNameToShift);
103-
const itemToMove = procedureBlock.inputList.splice(originalPosition, 1)[0];
104103

105104
if (
106105
(newPosition == 0 && original.type === 3/*Blockly.NEXT_STATEMENT*/) ||
107-
(originalPosition == 0 && itemToMove.type === 3/*Blockly.NEXT_STATEMENT*/)
106+
(originalPosition == 0 && procedureBlock.inputList[newPosition].type === 3/*Blockly.NEXT_STATEMENT*/)
108107
) {
109108
return false
110109
}
111110

111+
const itemToMove = procedureBlock.inputList.splice(originalPosition, 1)[0];
112+
112113
procedureBlock.inputList.splice(newPosition, 0, itemToMove);
113114

114115
Blockly.Events.disable();

0 commit comments

Comments
 (0)