Problem description
Clicking on a label whose touchEnabled property is set to false, still triggers the touchStart event on the parent object. So, if the label is included into a view, the touchStart event of the view is triggered twice.
This is happening only if the touchEnabled property is set to false.
If is set to true, or if the bubbleParent property is set to false, the touchStart event is triggered only once.
\\
This behavior is not reproducible with TiSDK 3.2.0
\\
Steps to reproduce
controller/index.js
function touchstart(e){
e.source.backgroundColor='red';
Ti.API.info('#### touchstart');
};
function touchend(e){
e.source.backgroundColor='orange';
Ti.API.info('#### touchend');
};
$.index.open();
styles/app.tss
"Window": {
backgroundColor: "#888"
}
"#label": {
font:{
fontSize:'28dp'
},
color:'yellow',
text:'click on the Blue view, then on the Label',
touchEnabled:false,
// bubbleParent:false
}
"View":{
top:'5%',
bottom: '5%',
left:'5%',
right:'5%',
backgroundColor:'blue'
}
views/index.xml
<Alloy>
<Window>
<View onTouchstart="touchstart" onTouchend="touchend">
<Label id='label'/>
</View>
</Window>
</Alloy>
1. Run the sample code on Android, check the logs and click on the Blue view (not on the label)
Result: touchstart event is triggered once, background color turns to red then orange after the touchend event
2. Click on the label
Result: touchstart event is now triggered twice, label background color turns red, but then the touchend event is not triggered for the label and it remains red
3. Comment out 'touchEnabled:false' from app.tss, rebuild and click on the label
Result: touchstart is only triggered once
4. Set touchEnabled:false and bubbleParent:false in app.tss, rebuild and click on the label
Result: touchstart is only triggered once
Since it does not appear in 3.2.0, and there are no more 3.1.X branches, I will consider it fixed.
Verified as fixed. TiSDK 3.2.0.v20131017152001 CLI 3.2.0 Titanium Studio 3.2.0.201310152326 Closing.