sproutcore/sproutcore-touch — Issue #8: Touch events are not passed through child elements
Author: ralfschimmel
Created: 2011-10-24 13:58:44+00:00
State: open

I have a collection which has a itemViewClass. The itemViewClass has a touch configuration. Childs of the itemViewClass do not pass the touch events down to it's parent. In the code sample clicking on the string which is shown in the span does not trigger a touch event in A.someItemView, clicking besides the content of the span does work (e.g. clicking on the itemViewClass).

{{#collection SC.CollectionView contentBinding="content" tagName="ul" itemTagName="li" itemViewClass="A.someItemView"}}
{{content.propertyA}}
{{/collection}}

A.someItemView = SC.View.extend({

mouseDown: function(evt) {
this.tapStart(evt);
},

mouseUp: function(evt) {
this.tapEnd(evt);
},

tapStart: function(gesture, args) {
this.set('selected', true);
},

tapCancel: function(gesture) {
this.set('selected', false);
},

tapEnd: function(gesture, args) {
this.set('selected', false);
}
});