ant-design MenuItem title stop working when it has children.

dfddblmv  于 3个月前  发布在  其他
关注(0)|答案(5)|浏览(54)

Steps to reproduce

Create a MenuItem array, assign title property to all top level items, then some add children, some doesn't add children.

What is expected?

Menu item title should show a string when mouse hover.

What is actually happening?

It only shows when there's no children
| Environment | Info |
| ------------ | ------------ |
| antd | 5.16.5 |
| React | 4.4.4 |
| System | Win11 |
| Browser | Edge & Chrome |

https://codesandbox.io/p/sandbox/menu-item-title-6glrvk?file=%2Fsrc%2FApp.tsx

Above example will show details.

bweufnob

bweufnob2#

Combining the document for review, it appears that this feature has not yet been implemented. When a "child" exists, what is actually rendered is not a "MenuItem" but a "SubMenu", and the "SubMenu" does not have a "title" attribute.

xhv8bpkk

xhv8bpkk3#

Title is very important for collapsed menu items.

tvokkenx

tvokkenx4#

@li-jia-nan 哥,这个需要做不

jjhzyzn0

jjhzyzn05#

@li-jia-nan 哥,这个需要做不

感觉可以做,但是我拿不准,问问大佬 @zombieJ@MadCcc

相关问题