Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant Design - Make Menu Uncollapsable/Unfoldable

Tags:

reactjs

antd

I am using Ant Design with React. Ant Design has a menu component: https://ant.design/components/menu/

Is it possible to make the menu uncollapsable/unfoldable? I read the documentation, and there was no parameter to turn off folding/collapsing.

like image 207
Roymunson Avatar asked Nov 23 '18 02:11

Roymunson


2 Answers

I know I'm coming late to the party but for other people struggling with this - there is an undocumented (as far as I could tell from official docs) prop of Menu component called disabledOverflow. Setting it to true solved it for me.

Kudos to VS Code editor, it suggested this property to me and saved my day!

like image 54
MrTanguero Avatar answered Nov 17 '22 23:11

MrTanguero


I made it work by including a min-width style object to the Menu

<Menu
    theme="dark"
    mode="horizontal"
    style={{minWidth: '800px'}}
>
...
</Menu>
like image 2
Fabio Espinosa Avatar answered Nov 17 '22 23:11

Fabio Espinosa