[TIMOB-10153] Android: Button: Touchend event not fired when touchmove gesture moves out of button
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-08-16T14:58:59.000+0000 |
Affected Version/s | Release 2.1.1 |
Fix Version/s | Sprint 2012-16 API, Release 2.1.2, Release 3.0.0 |
Components | Android |
Labels | api, module_button, parity, qe-and070112, qe-testadded |
Reporter | Satyam Sekhri |
Assignee | Karl Rowley |
Created | 2012-07-26T02:55:42.000+0000 |
Updated | 2012-08-16T19:25:33.000+0000 |
Description
The touchend event is not fired for button when touchmove moves outside the button
This is not a regression. This occurs as far as 2.0.1
Steps to Reproduce:
1. Create an app with code below and launch the app
2. Touch on the button and without ending the touch move finger outside the button
Expected: The touchend event should fire when touch gesture ends, as in iOS
Actual: touchend event is not fired and touchmove event for button continues to fire even after touchend outside the button
var win = Ti.UI.createWindow();
var button = Ti.UI.createButton({
top:'10%',
bottom:'10%',
left:'10%',
right:'10%'
});
button.addEventListener('touchmove',function(){
Ti.API.info('touchmove fired');
button.title = 'touchmove fired'
});
button.addEventListener('touchstart',function(){
Ti.API.info('touchstart fired');
button.title = 'touchstart fired'
});
button.addEventListener('touchend',function(){
Ti.API.info('touchend fired');
button.title = 'touchend fired'
});
win.add(button);
win.open();
Android actually fires a touchcancel (manually) if the point is outside the bounds of the view.
Pull request https://github.com/appcelerator/titanium_mobile/pull/2669
Verified fixed with: Titanium Studio, build: 2.1.1.201207271312 Titanium SDK, build: 2.2.0.v20120810132430 Device: Samsung Nexus S (4.1.1)