Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1701] Picker not responding to touch events

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2011-05-17T14:18:26.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0
ComponentsAndroid
Labelsandroid, defect
ReporterKevin Whinnery
AssigneeKevin Whinnery
Created2011-04-15T02:59:53.000+0000
Updated2011-05-17T14:18:26.000+0000

Description

In the android_native_refactor branch, picker is not responding to touch events. Code to repro:

(link removed)

(function() {
     var suites = ['login', 'test 1', 'test 2', 'test 3'];

     var testWindow = Ti.UI.createWindow({
             exitOnClose: true,
             backgroundColor: '#0000FF'
     });

     var suitePicker = Ti.UI.createPicker({
             left: 0,
             right: 0,
             top: 30
     });
     suitePicker.add(suites.map(function(suite) {
             return Ti.UI.createPickerRow({title: suite});
     }));
     
     testWindow.add(suitePicker);

     testWindow.open();
})();

addendum - you can use the trackball to select and open the picker

Comments

  1. kevinwhinnery 2011-04-15

    Our array prototype has:

       Array.prototype.map = function(f) {
         var output = [];
         for (var i=0; i<this.length; i++) {
             output.push(f(this[i]));
         }
         return output;
       };
       
  2. Bill Dawson 2011-04-15

    You're saying that when you tap on the picker, it doesn't show its dropdown? It's working fine for me both in the emulator and on my HTC Desire.

  3. Bill Dawson 2011-04-15

    BTW, this was my complete test. All of this was in app.js:

       
       Titanium.UI.setBackgroundColor('#000');
       Array.prototype.map = function(f) {
         var output = [];
         for (var i=0; i<this.length; i++) {
             output.push(f(this[i]));
         }
         return output;
       };
       (function() {
            var suites = ['login', 'test 1', 'test 2', 'test 3'];
       
            var testWindow = Ti.UI.createWindow({
                    exitOnClose: true,
                    backgroundColor: '#0000FF'
            });
       
            var suitePicker = Ti.UI.createPicker({
                    left: 0,
                    right: 0,
                    top: 30
            });
            suitePicker.add(suites.map(function(suite) {
                    return Ti.UI.createPickerRow({title: suite});
            }));
       
            testWindow.add(suitePicker);
       
            testWindow.open();
       })();
       
  4. Thomas Huelbert 2011-04-15

    Using Bills code, I saw the correct behavior (using trackball and touch) on a nexus 1 (2.2) and a g1 (1.6) I was I was able to invoke the picker and select an item.

  5. Bill Dawson 2011-04-15

    Kevin,
    Thomas and I apparently got this working fine. Do you want to close as Invalid? (It's an oldie).

  6. Bill Dawson 2011-04-15

    ping kevin.

  7. Eric Merriman 2011-05-17

    Could not reproduce with 1.7.0RC1. Closing.

JSON Source