Fix ordering with d&d
This commit is contained in:
@@ -41,9 +41,8 @@ class SignupQuestionsWidget extends React.Component<SignupQuestionsWidgetProps,
|
||||
const srcIndex = result.source.index;
|
||||
const dstIndex = result.destination.index;
|
||||
const srcCopy = { ...questions[srcIndex] };
|
||||
const dstCopy = { ...questions[dstIndex] };
|
||||
questions[dstIndex] = srcCopy;
|
||||
questions[srcIndex] = dstCopy;
|
||||
questions.splice(srcIndex, 1);
|
||||
questions.splice(dstIndex, 0, srcCopy);
|
||||
|
||||
this.onValueChange(questions);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user