diff --git a/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx b/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx index f3250c935..ac31e8b4e 100644 --- a/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx +++ b/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx @@ -70,7 +70,7 @@ const isChildActive = (itemUrl, pathname) => { return pathname.indexOf(itemUrl) > -1; }; -const MegaMenu = ({ item, pathname }) => { +const MegaMenu = ({ item, pathname, closeMenu }) => { const intl = useIntl(); const blocksFieldname = getBlocksFieldname(item); const blocksLayoutFieldname = getBlocksLayoutFieldname(item); @@ -317,7 +317,10 @@ const MegaMenu = ({ item, pathname }) => { title={child.title} condition={!!child['@id']} key={child['@id']} - onClick={() => setMenuStatus(false)} + onClick={() => { + setMenuStatus(false); + closeMenu(); + }} className={cx('list-item', { active: isChildActive( flattenToAppURL(child['@id']), diff --git a/src/customizations/volto/components/theme/Navigation/Navigation.jsx b/src/customizations/volto/components/theme/Navigation/Navigation.jsx index 50370ae0a..229981508 100644 --- a/src/customizations/volto/components/theme/Navigation/Navigation.jsx +++ b/src/customizations/volto/components/theme/Navigation/Navigation.jsx @@ -140,6 +140,9 @@ const Navigation = ({ pathname }) => { item={item} pathname={pathname} key={index + 'mm'} + closeMenu={() => { + setCollapseOpen(false); + }} /> ))}