Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14534] Android: 'touchEnabled:false' triggers touchstart event incorrectly

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-10-17T20:37:12.000+0000
Affected Version/sRelease 3.1.1, Release 3.1.2
Fix Version/sRelease 3.2.0
ComponentsAndroid
Labelsqe-3.1.2, qe-testadded
ReporterFederico Casali
AssigneeIngo Muschenetz
Created2013-07-12T01:29:30.000+0000
Updated2013-10-18T17:31:25.000+0000

Description

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

Comments

  1. Ingo Muschenetz 2013-10-17

    Since it does not appear in 3.2.0, and there are no more 3.1.X branches, I will consider it fixed.
  2. Federico Casali 2013-10-18

    Verified as fixed. TiSDK 3.2.0.v20131017152001 CLI 3.2.0 Titanium Studio 3.2.0.201310152326 Closing.

JSON Source