I am trying to implement components for Salesforce1 using touchstart, touchmove and touchend dom events on the dom elements inside my components. Normally the event that is passed to the callback function includes changedTouches attribute, which is also the case with Locker Service on. However, the objects inside this attribute are locked by the locker service which makes the touch functionality inaccessible. Does anyone know of an efficient way to access touch events?
Here is an example of the component that is using one of the event listeners:
test.cmp
<aura:component implements="force:appHostable"><!-- apphostable to be able to expose component as custom lightning tab -->
<div aura:id="container">
<div style="background:red; width:400px; height: 1000px;"></div>
</div>
</aura:component>
testRenderer.js
afterRender: function( cmp, h ) {
cmp.getElement().addEventListener('touchstart', function(e){
var touchobj = e.changedTouches[0];
console.log('touchstart', touchobj); // when locker service is on, touchobj is empty
}, false);
}
Result on touch: