-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
列表渲染中阻止冒泡事件报错 #3946
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
你打印下看 e 是什么 |
e 是正常的,包含了 stopPropagation 函数,且 typeof e.stopPropagation === 'function'。 changedTouches: [{…}]
currentTarget: {id: "", offsetLeft: 325, offsetTop: 151, dataset: {…}, x: 352.33984375, …}
detail: {x: 352.33984375, y: 174.95703125}
mark: {}
preventDefault: ƒ ()
stopPropagation: ƒ ()
target: {id: "", offsetLeft: 325, offsetTop: 151, dataset: {…}, x: 352.33984375, …}
timeStamp: 5138
touches: [{…}]
type: "tap" |
你打印的地方同时也是你报错的地方吗 |
当然,是写在一起的,确实很诡异。 |
同样遇到错误 |
taro 2.6.0 e[0].stopPrapagation();可以阻止冒泡,event是个数组 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
在列表渲染的情况下,尝试用 e.stopPropagation() 阻止冒泡,提示 e.stopPropagation is not a function。
尝试用 #761 (comment) 的方法包装一层 View,但是仅在列表中只有一个元素的时候不报错,其他情况下依旧报错。
复现步骤
期望行为
使用 e.stopPropagation() 不报错的情况下阻止冒泡。
报错信息
thirdScriptError
e.stopPropagation is not a function; [Component] Event Handler Error @ components/auto-complete/index#(anonymous)
TypeError: e.stopPropagation is not a function
系统信息
Taro CLI 1.3.9 environment info:
System:
OS: macOS 10.14.5
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.1.0 - /usr/local/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.10.1 - /usr/local/bin/npm
npmGlobalPackages:
typescript: 2.5.3
The text was updated successfully, but these errors were encountered: