Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-2547

TextField never looses focus when action performed in Blur event (re-focuses afterwards)

    Details

      Description

      As of 2.1.3.GA it's no longer possible to loose focus from TextFields if you're performing some action in the 'blur' event.

      Blur event code will fire, but the TextField will gain focus again, making the keyboard active again and so preventing access to UI elements obscured by the keyboard.

      Interestingly, the 'focus' event does not seem to get fired when the TextField gets the focus again (but not 100% sure!).

      Below is an example of some code that triggers this. This code simply removes a background color I'm applying to a TableRow highlighting the data item being edited.

      txtUsername.addEventListener('blur', function(e) {
      	FM.settings.setUsername(txtUsername.value.trim());
      	txtOnBlur(e);
      });
       
      function txtOnBlur(e) {
      	var truerow = FM.ui.helper.getTrueRowByType(e.source)
      	truerow.setBackgroundColor(FM.ui.theme.tableViewRowBackgroundNormal);
      };
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mpmiranda Mauro Parra-Miranda
                Reporter:
                gavinharriss Gavin Harriss
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Integration