ant-design dropdown's submenu is not injected into getPopupContainer defined in < Dropdown />

kpbwa7wx  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(45)

Steps to reproduce

inspect element, first level menu is right in the container, second level menu is injected into child div of body.

What is expected?

all level menu is right placed in custom container

What is actually happening?

dropdown's submenu is not injected into getPopupContainer defined in
| Environment | Info |
| ------------ | ------------ |
| antd | undefined |
| React | ^18.2.0 |
| System | all |
| Browser | all |

rslzwgfq

rslzwgfq1#

try this

menu={{ items, getPopupContainer: () => document.getElementById('container') }}

Because the triggerElement of SubMenu is not <a>...</a> , it's the Menu.Item

h4cxqtbf

h4cxqtbf2#

try this

menu={{ items, getPopupContainer: () => document.getElementById('container') }}

Because the triggerElement of SubMenu is not <a>...</a> , it's the Menu.Item

thanks you, should i close this issue or keep it open to trace this "bug"?

相关问题