Description
When changing the date in the DatePicker in MobileWeb, the 'change' event is not fired when clicking on the calendar.
Code
var win = Titanium.UI.createWindow({
backgroundColor : 'white'
});
var picker = Ti.UI.createPicker({
type : Ti.UI.PICKER_TYPE_DATE,
minDate : new Date(2009, 0, 1),
maxDate : new Date(2014, 11, 31)
});
picker.addEventListener('change', function(evt) {
alert('Changed date ' + evt.value);
});
win.add(picker);
win.open();
Test case
1. Click on the date picker (event will fire)
2. Click on the arrow to show the calendar, and pick a date (no event fired)
3. Click on the arrow again and event will fire now
Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5852 3_3_X pull request: https://github.com/appcelerator/titanium_mobile/pull/5853 There were quite a number of bugs and parity issues that I fixed.
Alert is displayed when the date is changed as expected.
[~dcassenti] Being that this file hasn't been updated since the 3.1 days, it's probably easier to just tell them to drop https://raw.githubusercontent.com/appcelerator/titanium_mobile/master/mobileweb/titanium/Ti/UI/Picker.js into their 3.2.3 SDK.
Fixed a typo: Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5858 3_3_X pull request: https://github.com/appcelerator/titanium_mobile/pull/5859
Verified fixed on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.3.0.201406231625 Titanium SDK, build: 3.3.0.v20140626144112 Titanium CLI, build: 3.3.0-rc3 Alloy: 1.4.0-rc2 DataPicker 'change' event fires successfully when clicking on the calendar drop down option. Correct date is also shown in the alert thrown by the change event. Closing.
Tested same environment with following devices: iPhone 5C iOS 7.1 Safari Galaxy S4 Android version 4.4.2 BB Z10 version 10.2.1