diff --git a/package-lock.json b/package-lock.json index 4dee62a..1870c1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21062,6 +21062,16 @@ "csstype": "^3.0.2" } }, + "dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" + }, + "dotenv-expand": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz", + "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==" + }, "ejs": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", diff --git a/src/Hooks/useReOrderQuestions.ts b/src/Hooks/useReOrderQuestions.ts index 12f7896..aa65634 100644 --- a/src/Hooks/useReOrderQuestions.ts +++ b/src/Hooks/useReOrderQuestions.ts @@ -26,7 +26,7 @@ export function useReOrderQuestions() { if (index <= 0) return; const next = moveToTop(index, values.Questions); setFieldValue("Questions", withSubOrder(next)); - afterLayout(() => scrollToIdWithOffset(`q-${item.id}`)); + afterLayout(() => scrollToIdWithOffset(`q-${item.id || item.unique}`)); }; @@ -34,7 +34,7 @@ export function useReOrderQuestions() { if (index >= values.Questions.length - 1) return; const next = moveToBottom(index, values.Questions); setFieldValue("Questions", withSubOrder(next)); - afterLayout(() => scrollToIdWithOffset(`q-${item.id}`)); + afterLayout(() => scrollToIdWithOffset(`q-${item.id || item.unique}`)); }; diff --git a/src/Pages/Admin/question/Model/EditForm/BaseFormContainer.tsx b/src/Pages/Admin/question/Model/EditForm/BaseFormContainer.tsx index ea663d9..ad01a75 100644 --- a/src/Pages/Admin/question/Model/EditForm/BaseFormContainer.tsx +++ b/src/Pages/Admin/question/Model/EditForm/BaseFormContainer.tsx @@ -95,7 +95,7 @@ const BaseFormContainer = ({ enableReinitialize > {({ values, isValid, handleSubmit, dirty }) => ( -