diff --git a/package.json b/package.json index e14284e..5398ed0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-pro-sidebar", - "version": "1.0.0-alpha.4", + "version": "1.0.0-alpha.5", "description": "high level and customizable side navigation", "main": "dist/index.js", "module": "dist/index.es.js", diff --git a/src/components/SubMenu.tsx b/src/components/SubMenu.tsx index b546aed..abf60a7 100644 --- a/src/components/SubMenu.tsx +++ b/src/components/SubMenu.tsx @@ -125,7 +125,7 @@ export const SubMenuFR: React.ForwardRefRenderFunction): void => { onClick?.(event); - if (level === 0 && collapsed) setOpenWhenCollapsed(!openWhenCollapsed); + if (level === 0 && collapsed) setOpenWhenCollapsed((prevState) => !prevState); else if (typeof openSubmenu === 'undefined') { onOpenChange?.(!open); setOpen(!open); @@ -139,6 +139,14 @@ export const SubMenuFR: React.ForwardRefRenderFunction` ${({ collapsed, firstLevel, openWhenCollapsed }) => collapsed && firstLevel ? ` - margin-left: 5px!important; - margin-right: 5px!important; + padding-left: 0px; width: 200px; border-radius: 4px;