[ https://issues.apache.org/jira/browse/WEEX-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16586840#comment-16586840 ]
codefurture commented on WEEX-519: ---------------------------------- when you scroll, touch is comsumed by scroller > scroller子项touchend事件在滚动时无法获取或触发 > ------------------------------- > > Key: WEEX-519 > URL: https://issues.apache.org/jira/browse/WEEX-519 > Project: Weex > Issue Type: Bug > Components: Project > Affects Versions: 0.18 > Environment: 测试在Android手机上,ios还未测试过 > Reporter: gexiaoming > Assignee: codefurture > Priority: Critical > > 需要获取scroller子项的touchend,touchstart事件 > touchstart事件都可以获取到 > 但是touchend事件比较奇怪,子项加入@touchend,如果只是触碰一下,没有滚动的话,事件是有触发的,一旦滚动起来,事件就没了 > 代码如下 > {code:java} > <template> > <div> > <scroller class="list" scroll-direction="horizontal" ref="scroll" > > <div class="cell" @touchstart="touchstart" @touchend="touchend(2)" > > <div class="panel" > > <text class="text" >1234</text> > </div> > </div> > <div class="delete"> > <text class="text">delete</text> > </div> > </scroller> > </div> > </template> > <script> > const modal = weex.requireModule("modal"); > export default { > methods: { > touchstart: function(e) { > modal.toast({ message: "touchstart" }); > }, > touchend: function(e) { > modal.toast({ message: "touchend" + e }); > } > } > }; > </script> > <style scoped> > .panel { > width: 600px; > height: 250px; > margin-left: 75px; > margin-top: 35px; > margin-bottom: 35px; > flex-direction: column; > justify-content: center; > border-width: 2px; > border-style: solid; > border-color: rgb(162, 217, 192); > background-color: rgba(162, 217, 192, 0.2); > } > .text { > font-size: 50px; > text-align: center; > color: #41b883; > } > .list { > flex-direction: row; > height: 300px; > } > .delete { > width: 200px; > height: 250px; > margin-left: 75px; > margin-top: 35px; > margin-bottom: 35px; > flex-direction: column; > justify-content: center; > border-width: 2px; > background-color: red; > } > </style> > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)