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

[Rate] Rate组件点击事件没有向上传递 #3270

Open
dlxbcn opened this issue Nov 10, 2024 · 3 comments
Open

[Rate] Rate组件点击事件没有向上传递 #3270

dlxbcn opened this issue Nov 10, 2024 · 3 comments

Comments

@dlxbcn
Copy link

dlxbcn commented Nov 10, 2024

tdesign-miniprogram 版本

1.7.0

重现链接

this.onTouch(e, 'tap');

重现步骤

列表页加了Rate 控件,但Rate 组件点击没反应,也不能传递点击事件,导致列表页无法跳转到详情页

期望结果

就算Rate控件设置了disalbe,也可以向上传递点击事件

实际结果

No response

基础库版本

No response

补充说明

可以向上传点击事件,类似this.triggerEvent('click', e);

https://github.com/Tencent/tdesign-miniprogram/blob/b193a61b3da6afd98bb5b75e2254ea2befca6ba5/src/tag/tag.ts#L85C7-L85C37

Copy link
Contributor

👋 @dlxbcn,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@anlyyao
Copy link
Collaborator

anlyyao commented Nov 12, 2024

@dlxbcn 什么叫做“就算Rate控件设置了disalbe,也可以向上传递点击事件”, 禁用就是禁用

@dlxbcn
Copy link
Author

dlxbcn commented Nov 12, 2024

@anlyyao 我来解释一下这个场景,看这段代码
<view bind:tap="gotTap"> {{text}} <input value="123" disabled/> <t-rate value="{{4}}" disabled /> </view>

Page({ data: { text:"" }, gotTap(e){ this.setData({text:"clicked"}); setTimeout(()=>{ this.setData({text:""}); }, 3000) }, })

这段代码在点击【input】的时候,父控件是可以收到点击事件的,但点击【t-rate】控件时,父控件就无法收到点击事件了,通过这个实验,我觉得 disabled 可以理解为【禁用】,但只是这个控件不响应,并不应该阻止事件冒泡。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants