Skip to content

Commit

Permalink
fix: lazy mount accordions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas-C committed Oct 9, 2024
1 parent b8cdf1c commit 20d418d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/Accordion/FormAccordions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const FormAccordions = ({ defaultOpen, children }: Props) => {
multiple
value={openAccordions}
onValueChange={(details) => setOpenAccordions(details.value)}
lazyMount
unmountOnExit
>
{children}
</StyledAccordionRoot>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Accordion/FormAccordionsWithComments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ const FormAccordionsWithComments = ({ defaultOpen, children, article, taxonomy,
multiple
value={openAccordions}
onValueChange={(details) => setOpenAccordions(details.value)}
lazyMount
unmountOnExit
>
{children}
</StyledAccordionRoot>
Expand Down
2 changes: 1 addition & 1 deletion src/containers/FormikForm/VersionAndNotesPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const VersionAndNotesPanel = ({ article, articleHistory, type, currentLanguage }
/>
)}
</FormikField>
<StyledAccordionRoot multiple defaultValue={["0"]} variant="clean">
<StyledAccordionRoot multiple defaultValue={["0"]} variant="clean" lazyMount unmountOnExit>
{articleHistory.map((version, index) => {
const isLatestVersion = index === 0;
const published =
Expand Down

0 comments on commit 20d418d

Please sign in to comment.