Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19345] Android: DatePicker change event does not fires in Lollipop

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-09-29T02:44:45.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.1.0
ComponentsAndroid
Labelsdatepicker, parity
ReporterEduardo Gomez
AssigneeHieu Pham
Created2015-08-12T23:35:00.000+0000
Updated2016-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 work

Test 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

FileDateSize
Android_JellyBean_Picker.png2015-08-12T23:33:13.000+000020246
Android_Lollipop_Picker.png2015-08-12T23:33:19.000+000045457
iOS_Picker.png2015-08-12T23:33:08.000+000048822

Comments

  1. Lokesh Choudhary 2015-08-17

    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
  2. Ashraf Abu 2015-09-03

  3. Ashraf Abu 2015-09-04

    [~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?
  4. Hieu Pham 2015-09-28

    "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
  5. Ashraf Abu 2015-09-29

    Merged PR
  6. Ashraf Abu 2015-09-29

  7. Lokesh Choudhary 2015-10-01

    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

JSON Source