[TIMOB-8907] Android: click event does not fire correctly when touchStart listener is present on view
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-05-25T17:38:28.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Release 2.1.0, Sprint 2012-11 Core |
Components | Android |
Labels | core, module_gesture, qe-testadded |
Reporter | Opie Cyrus |
Assignee | Max Stepanov |
Created | 2012-04-27T17:34:06.000+0000 |
Updated | 2012-07-12T12:03:38.000+0000 |
Description
Click event does not fire for view when a touchStart listener is present on view. Example code:
var baseHeight = 200;
var baseWidth = 200;
var win = Ti.UI.createWindow({
backgroundColor: '#fff',
fullscreen: false,
exitOnClose: true
});
var view = Ti.UI.createView({
height: baseHeight,
width: baseWidth,
backgroundColor: '#a00'
});
var label = Ti.UI.createLabel({
text: baseWidth + ' x ' + baseHeight,
color: '#fff',
font: {
fontSize: 24,
fontWeight: 'bold'
}
});
view.add(label);
win.add(view);
view.addEventListener('pinch', function(e) {
view.height = baseHeight * e.scale;
view.width = baseWidth * e.scale;
label.text = Math.round(view.width) + ' x ' + Math.round(view.height);
});
view.addEventListener('touchstart', function(e) {
baseHeight = view.height;
baseWidth = view.width;
});
view.addEventListener('click', function(e) {
Ti.API.info(">>>>>>>>>> inside click event");
});
win.open();
Commenting out the touchstart listener will allow the click events to get through.
PR pending https://github.com/appcelerator/titanium_mobile/pull/2250
Click event fires correctly in sample code. Tested on Titanium Studio, build: 2.2.0.201206222035 Titanium SDK: 2.1.0.v20120622174154 Device:Xoom(4.0.3)
verified fix with Titanium Studio, build: 2.1.0.201206221045 Titanium SDK: 2.1.0.v20120622174154 Device: Nexus S 4.0.4