Reputation: 53
it is possible to apply word-wrap in a Menu.Item component ?
example not working: https://codepen.io/tiagowippel/pen/LYEKYbb?editable=true&editors=001
<Menu.Item key="1">Option 1Option 1Option 1Option 1Option 1Option 1Option 1Option 1</Menu.Item>
Upvotes: 3
Views: 4431
Reputation: 2719
You can set some style to your Menu.Item
:
<Menu.Item key="1" style={{whiteSpace: 'normal', height: 'auto'}}>Option 1Option 1Option 1Option 1Option 1Option 1Option 1Option 1</Menu.Item>
Upvotes: 6
Reputation: 801
The default CSS you're importing from Ant is set to truncate. You'll want to change the white-space property:
white-space: normal;
You may then notice that the wrapped text is overflowing in the y axis now. You can change your height to accommodate variable height content:
height: auto;
Upvotes: 8