Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-12139

Android: Textfield change event behaves differently in 2.1.4 and 3.0.0 SDK

    Details

      Description

      Issue

      The textfield change event listener in 2.1.4 is fired differently from 3.0.0.GA SDK.

      Steps to Reproduce

      Run the sample below:

       
      var win = Ti.UI.createWindow({
          backgroundColor : 'white'
      });
       
      win.open();
       
      var view = Ti.UI.createView({
          backgroundColor : 'red',
          top : 20,
          left : 20,
          height : 400,
          width : 300,
          layout: 'vertical'
      });
       
      win.add(view);
       
      var textfield = Ti.UI.createTextField({
          left: 20,
          right: 20,
          height: 40,
          //maxLength: 6,
          borderColor: 'black',
          borderWidth: 2,
          value: 'Hello'
      });
      view.add(textfield);
       
      var countChangeEvents = 0;
      textfield.addEventListener('change', function(_evt){
          countChangeEvents++;
          Ti.API.info('change event fired: ' + countChangeEvents);
          var value = _evt.source.value; 
          if (value == 'HelloA'){
              Ti.API.info('replace');
              textfield.value = value.replace('Hello', '*****');
          }
      });
      
      

      2. Enter the letter "A" at the end of the text in the textfield.

      3. Notice the characters before A turn to "*".

      4. If you look at the logs the API info statements show 2 change events fired for the above steps in 3.0.0.GA while in 2.1.4.GA, 3 events were fired.

      Is this an intentional behavior?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pwang Ping Wang
                Reporter:
                vjoshi Varun Joshi
                Reviewer:
                Hieu Pham
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-15228
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration