ant-design Menu-只展开当前父级菜单 demo openKeys 处理错误

z18hc3ub  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(118)

https://ant-design.antgroup.com/components/menu-cn#menu-demo-sider-current

Steps to reproduce

  1. 点击 Navigation Two
  2. 点击 Submenu
  3. 再次点击 Submenu

What is expected?

当再次点击 Submenu 后,Navigation Two 被收起了

What is actually happening?

Navigation Two 不应该被收起
| Environment | Info |
| ------------ | ------------ |
| antd | 5.15.2 |
| React | latest |
| System | mac |
| Browser | chrome |

这个问题是上次 #44221 改动导致的

dfddblmv

dfddblmv1#

另外在 https://stackblitz.com/edit/react-qff6t5?file=demo.tsx 里,展开了 Submenu 后再次展开 Submenu 2Submenu 不会被收起。这个 openKeys 的逻辑有问题,需要修改

相关问题