Skip to content

Commit 6190cfa

Browse files
committed
Fix accordion startOpen behaviour if Phy's audience calculation undefined
1 parent fe80bd2 commit 6190cfa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/components/content/IsaacAccordion.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ export const IsaacAccordion = ({doc}: {doc: ContentDTO}) => {
183183
{isPhy && stageInserts?.[index] && <StageInsert stage={stageInserts[index]} />}
184184
<Accordion
185185
key={`${section.sectionIndex} ${index}`} id={section.id} index={index}
186-
startOpen={section.startOpen || index === firstSectionToOpen} deEmphasised={section.deEmphasised}
186+
startOpen={section.startOpen || !isDefined(firstSectionToOpen) ? undefined : index === firstSectionToOpen} /* use default <Accordion/> startOpen behaviour if behaviour undefined */
187+
deEmphasised={section.deEmphasised}
187188
trustedTitle={section?.title || ""}
188189
audienceString={audienceString}
189190
>

0 commit comments

Comments
 (0)