Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversations组件菜单点击后对应的项会被激活 #528

Open
jacksonrick opened this issue Feb 11, 2025 · 2 comments
Open

Conversations组件菜单点击后对应的项会被激活 #528

jacksonrick opened this issue Feb 11, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@jacksonrick
Copy link

重现步骤

1、当前激活第一个
Image
2、点击第二项的菜单
Image
3、第二项被激活了
Image

当前行为

点击第二项的菜单,第二项被激活了,触发了onActiveChange事件

预期行为

第一项仍被激活,且不会触发onActiveChange事件

上下文

No response

版本

1.0.5

您在哪些浏览器上遇到了这个问题?

Chrome

@jacksonrick jacksonrick added the bug Something isn't working label Feb 11, 2025
Copy link

感谢您提供详细的重现步骤和当前行为描述。根据您的描述,点击第二项的菜单后,第二项被激活并触发了onActiveChange事件,而您期望第一项仍然被激活且不会触发该事件。

这种行为可能是由于组件的事件处理逻辑导致的。为了帮助您解决这个问题,我建议您检查以下几点:

  1. 事件绑定:查看是否有不必要的事件绑定在菜单项上,导致点击菜单时触发了激活事件。
  2. 状态管理:确保组件的状态管理逻辑正确,特别是在处理激活状态时,确保点击菜单不会改变激活状态。
  3. 组件配置:查看组件的配置选项,是否有相关的配置可以控制菜单点击行为。

如果您需要进一步的帮助,您可以提供相关的代码片段,我可以帮助您分析并提出修改建议。

如果问题依然存在,您可以考虑在 ant-design/x 的 GitHub 仓库中查看是否有类似的问题报告,或者提交一个新的问题报告以获得更多支持。

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

@NewNash
Copy link

NewNash commented Feb 17, 2025

点击菜单后,阻止冒泡
menuInfo.domEvent.stopPropagation()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants