diff --git a/src/layouts/EditHomepage/EditHomepage.jsx b/src/layouts/EditHomepage/EditHomepage.jsx index c78926733..cf7a361c0 100644 --- a/src/layouts/EditHomepage/EditHomepage.jsx +++ b/src/layouts/EditHomepage/EditHomepage.jsx @@ -960,6 +960,11 @@ const EditHomepage = ({ match }) => { handleHighlightDropdownToggle={ handleHighlightDropdownToggle } + initialSectionType={ + section.hero.dropdown + ? "dropdown" + : "highlights" + } > {({ currentSelectedOption }) => currentSelectedOption === "dropdown" ? ( diff --git a/src/layouts/components/Homepage/HeroBody.tsx b/src/layouts/components/Homepage/HeroBody.tsx index 038540a79..a63aadfc3 100644 --- a/src/layouts/components/Homepage/HeroBody.tsx +++ b/src/layouts/components/Homepage/HeroBody.tsx @@ -51,6 +51,7 @@ interface HeroBodyProps extends HeroBodyFormFields { children: (props: { currentSelectedOption: HeroSectionType }) => React.ReactNode + initialSectionType: HeroSectionType } export const HeroBody = ({ @@ -62,9 +63,10 @@ export const HeroBody = ({ handleHighlightDropdownToggle, notification, children, + initialSectionType, }: HeroBodyProps) => { const [heroSectionType, setHeroSectionType] = useState( - "highlights" + initialSectionType ) const { onChange } = useEditableContext() @@ -147,7 +149,7 @@ export const HeroBody = ({ }, }) }} - defaultValue="highlights" + defaultValue={initialSectionType} > { const {