diff --git a/client/src/app/pages/assessment/components/questionnaire-form/multi-input-selection/multi-input-selection.tsx b/client/src/app/pages/assessment/components/questionnaire-form/multi-input-selection/multi-input-selection.tsx index 5a74d2d966..d2b08203d3 100644 --- a/client/src/app/pages/assessment/components/questionnaire-form/multi-input-selection/multi-input-selection.tsx +++ b/client/src/app/pages/assessment/components/questionnaire-form/multi-input-selection/multi-input-selection.tsx @@ -27,18 +27,17 @@ export const MultiInputSelection: React.FC = ({ const isArchetype = useIsArchetype(); const { t } = useTranslation(); - return ( {sortedOptions.map((option, i) => ( - + ( { diff --git a/client/src/app/pages/assessment/components/questionnaire-form/questionnaire-form.tsx b/client/src/app/pages/assessment/components/questionnaire-form/questionnaire-form.tsx index f352741111..4604f4ddf1 100644 --- a/client/src/app/pages/assessment/components/questionnaire-form/questionnaire-form.tsx +++ b/client/src/app/pages/assessment/components/questionnaire-form/questionnaire-form.tsx @@ -12,7 +12,7 @@ import { import HelpIcon from "@patternfly/react-icons/dist/esm/icons/help-icon"; import { MultiInputSelection } from "./multi-input-selection"; import { Question, QuestionHeader, QuestionBody } from "./question"; -import { getCommentFieldName } from "../../form-utils"; +import { getCommentFieldName, getQuestionFieldName } from "../../form-utils"; import { HookFormPFTextInput } from "@app/components/HookFormPFFields"; import { useFormContext } from "react-hook-form"; import { Section } from "@app/api/models"; @@ -54,7 +54,7 @@ export const QuestionnaireForm: React.FC = ({ {sortedQuestions.map((question) => ( - + @@ -74,7 +74,10 @@ export const QuestionnaireForm: React.FC = ({ - + diff --git a/client/src/app/pages/assessment/form-utils.ts b/client/src/app/pages/assessment/form-utils.ts index 1f2f54deb5..43fcb26f5d 100644 --- a/client/src/app/pages/assessment/form-utils.ts +++ b/client/src/app/pages/assessment/form-utils.ts @@ -15,6 +15,6 @@ export const getCommentFieldName = (section: Section, fullName: boolean) => { }; export const getQuestionFieldName = (question: Question, fullName: boolean) => { - const fieldName = `question-${question.text}`; + const fieldName = `question-${question.order}`; return fullName ? `${QUESTIONS_KEY}.${fieldName}` : fieldName; };