danielhanold / danielhanold.pickerwidget

Titanium widget that implements single column, date, and age-range pickers for iOS and Android
39 stars 13 forks source link

Android picker returns array index instead of object key #4

Closed fmendoza closed 10 years ago

fmendoza commented 10 years ago

When i select one item, the selected index is not the key of the pickerValues object.

danielhanold commented 10 years ago

Verified this bug; the picker is returning the index of the array, not the actual key of the pickerValues object. Will fix this shortly.

fmendoza commented 10 years ago

I made a little change to get this work (widget.js line 286)

Change:

key: e.index

to:

key: getKeyFromPairs(pickerValueArray, e.source.options[e.index])
danielhanold commented 10 years ago

Thanks for catching this bug. Oversight on my end. Fixed and pushed to the repo.