Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-727] Fix focus/blur events for windows and text fields

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:54:03.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.3.0
ComponentsAndroid
Labelsandroid, defect
ReporterMarshall Culpepper
AssigneeMarshall Culpepper
Created2011-04-15T02:35:14.000+0000
Updated2011-04-17T01:54:03.000+0000

Description

See:

  • Window events test
  • Controls - Text fields

Comments

  1. Marshall Culpepper 2011-04-15

    AFAICT this works like it should for Android, marking as resolved

  2. hal 2011-04-15

    Tested on: android emu, 1.4.X (2 Nov), 1.5.X (6 Nov), ubuntu

    It is extremely difficult to pinpoint, but in some cases the window focus event still does not fire. Run this app.js for example:

       
       var win1 = Titanium.UI.createWindow({
           title:'Window 1',
           backgroundColor:'#f00'
       });
       
       var win2 = Titanium.UI.createWindow({
           url:'window_focus.js',
           title:'Window 2',
           backgroundColor:'#0f0'
       });
       
       win1.addEventListener('click', function(){
           win2.open();
       });
       
       win1.addEventListener('focus', function(){
           Ti.API.info("------  in window1 focus event ----");
       });
       
       win2.addEventListener('focus', function(){
           Ti.API.info("------  in window2 focus event ----");
       });
       
       win1.open();
       

    Confusingly, the focus event in https://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/examples/window_events.js#L250"> window_events.js fires correctly.

  3. hal 2011-04-15

    btw, Marshall, I'm conscious about whether it's bad etiquette to reopen such an old, closed ticket. My reason for adding here was because the issue is not conclusive. If you want me to open a fresh one, just let me know as I would be happy to do so.

  4. vincent youmans 2011-04-15

    I dont think the issue is resolved. If you open a window in ANDROID, the FOCUS event fires. But if that win opens another window, then returns to the first window, the focus does not re-fire on ANDROID. It does re-fire on iPHONE. I wrote a demo app to demonstrate my point, but I dont know how to send it it. Its a compressed file at the moment. This demo app does not run from app.js.

    I posted the note here: http://developer.appcelerator.com/question/79371/focus-event-not-firing-when-returning-to-the-window"> http://developer.appcelerator.com/question/79371/focus-event-not-fi...
    and I tried to put the demo code up here: https://gist.github.com/675571">https://gist.github.com/675571

    my point, I dont belive that the focus event is resolved for ANDROID.

  5. hal 2011-04-15

    Vincent
    Your usecase code is far too complicated, containing too much superfluous functionality, to be useful here. Paste a new simple version to your thread on the appcel website, and I will look at it for you.

JSON Source