diff --git a/app/(gcforms)/[locale]/(form administration)/form-builder/components/shared/conditionals/ConditionalIndicator.tsx b/app/(gcforms)/[locale]/(form administration)/form-builder/components/shared/conditionals/ConditionalIndicator.tsx index 59736f1ef2..a518d714fa 100644 --- a/app/(gcforms)/[locale]/(form administration)/form-builder/components/shared/conditionals/ConditionalIndicator.tsx +++ b/app/(gcforms)/[locale]/(form administration)/form-builder/components/shared/conditionals/ConditionalIndicator.tsx @@ -17,8 +17,8 @@ const RuleIndicator = ({ choiceId }: { choiceId: string }) => { ); const elements = useTemplateStore((state) => state.form.elements); + // Ensure elements are sorted by layout const sortedElements = sortByLayout({ layout, elements: [...elements] }); - const parentId = Number(choiceId.split(".")[0]); const childId = Number(choiceId.split(".")[1]); const choice = getChoice(parentId, childId);