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

[Bug Report] AddressList 组件 edit 事件 会连带触发 click-item 事件 #12680

Closed
jiangzenong opened this issue Mar 15, 2024 · 2 comments · Fixed by #12748
Closed

[Bug Report] AddressList 组件 edit 事件 会连带触发 click-item 事件 #12680

jiangzenong opened this issue Mar 15, 2024 · 2 comments · Fixed by #12748

Comments

@jiangzenong
Copy link

重现链接

暂无链接地址

Vant 版本

4.8.5

描述一下你遇到的问题。

冒泡无法通过.stop禁止
我应该怎么做

重现步骤

1.添加edit事件
2.添加click-item事件
3.点击edit,先触发edit,紧接着就触发了click-item

设备/浏览器

No response

@chenjiahan
Copy link
Member

下个版本会在 click-item 里暴露原生的 event 对象,这样可以通过 event.target 来进行区分

const onClickItem = (item, index, { event }) => {
  console.log('click-item', item, index, event.target);
};

@chenjiahan
Copy link
Member

在点击 edit 的时候不触发 click-item 会更加合理,不过这个属于 breaking change,目前不会进行这个变更。

@youzan youzan deleted a comment from jiangzenong Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants