emberjs-addons / ember-touch

A lightweight library for building and using touch gestures with Ember Applications
MIT License
182 stars 28 forks source link

Touch events are not passed through child elements #8

Closed ralfschimmel closed 12 years ago

ralfschimmel commented 12 years ago

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"}}
    <span>{{content.propertyA}}</span>
{{/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);
    }
});
ppcano commented 12 years ago

The following test works.

May your write a fail test?

ralfschimmel commented 12 years ago

Fail test, more complicated template with a SC.View in the itemViewClass.

ppcano commented 12 years ago

Your tests pass in my fork project, i think is this commit the one which fix the problem.

Anyway, there is a open Pull Request which fix the issue.

ralfschimmel commented 12 years ago

Indeed your fork fixes it, vendored your fork for now.

ppcano commented 12 years ago

Closing it, in favor of the last merge.