[TIMOB-19345] Android: DatePicker change event does not fires in Lollipop
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-09-29T02:44:45.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.1.0 |
Components | Android |
Labels | datepicker, parity |
Reporter | Eduardo Gomez |
Assignee | Hieu Pham |
Created | 2015-08-12T23:35:00.000+0000 |
Updated | 2016-01-13T23:18:14.000+0000 |
Description
Issue Description
This issues does not occur on iOS. If you run the test case on Jelly Bean devices the change event is fired as expected.Tested on
iOS 8.1: Change event works Droid Razr 4.1.2: Change event works Moto G 5.0.2: Change event didn't workTest Case
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow({
exitOnClose : true,
});
var datePicker = Ti.UI.createPicker({
top: 100,
height : Ti.UI.SIZE,
width : Ti.UI.FILL,
type : Ti.UI.PICKER_TYPE_DATE,
minDate : new Date(),
value : new Date(),
color : "#000",
});
datePicker.addEventListener('change', function(e) {
alert(e.value);
Ti.API.info(e.value);
});
win.add(datePicker);
win.open();
Attachments
File | Date | Size |
---|---|---|
Android_JellyBean_Picker.png | 2015-08-12T23:33:13.000+0000 | 20246 |
Android_Lollipop_Picker.png | 2015-08-12T23:33:19.000+0000 | 45457 |
iOS_Picker.png | 2015-08-12T23:33:08.000+0000 | 48822 |
I can see the issue both on android 4.X & 5.0.1. Android 5.1.1 has the calendar type data picker & did not show this issue. Environment: Appc Studio : 4.2.0.201508062204 Ti SDK : 4.2.0.v20150817002027, 4.1.0.GA Ti CLI : 4.1.4 Alloy : 1.6.2 MAC Yosemite : 10.10.4 Appc NPM : 4.1.0 Appc CLI : 4.2.0-54 Node: v0.10.37 Nexus 6- Android 5.0.1 Nexus 5 - Android 5.1.1 Samsung Galaxy S4 - Android 4.4.2
[~lchoudhary] if this is indeed a duplicate of TIMOB-19192 and the behaviour is the same, can I close this as duplicate and continue this in TIMOB-19192?
"change" event should only fire once. Even though this is a native bug for certain Android versions, we should still fix it. master PR: https://github.com/appcelerator/titanium_mobile/pull/7240
Merged PR
Verified the fix. The change event is fired as expected in lollipop. Checked using the code in the description. Closing Environment: Appc Studio : 4.3.1.201509302304 Ti SDK : 5.1.0.v20151001150432 Ti CLI : 5.0.3 Alloy : 1.7.10 MAC Yosemite : 10.10.4 Appc NPM : 4.2.0 Appc CLI : 5.0.2 Node: v0.10.37 Nexus 5 - Android 5.0 Android 4.4.4