Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2923] iOS: Events don't bubble like they do on Android

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-05-21T10:00:17.000+0000
Affected Version/sRelease 1.6.0
Fix Version/sRelease 2.0.1
ComponentsiOS
Labelsparity, qe-port
ReporterDawson Toth
AssigneeNeeraj Gupta
Created2011-04-15T03:33:01.000+0000
Updated2012-08-28T10:50:29.000+0000

Description

Problem

When opening a window and focusing a text field, the events that fire are very inconsistent across Android and iOS. One way they are inconsistent is that Android will bubble events out, while iOS does not.

For example... you open a window, and click in a text field.

On iOS, the events fire in this order: window focus, textfield focus.

On Android, the events fire in this order: textfield focus, window focus, textfield click, window click.

Expected Behavior

Events should be consistent across the platforms. Perhaps it could be optional to turn on event bubbling on iOS, and it could be made optional by default on Android as well.

Tested On

Titanium Mobile 1.6.0 1/19/11
iPhone Simulator 4.2
Android Simulator 2.2

Sample Code

Attached. Follow the instructions in the Ti.UI.Label created by the app, and look at the Ti Developer console to see when events are firing and if they are expected or not.

In the iPhone simulator, my console showed the following:

[INFO] PASS: window-focus fired
[ERROR] FAIL: Skipped expected textfield-click
[INFO] PASS: textfield-focus fired

Android showed the following:

[ERROR] [2257,2269] FAIL: textfield-focus fired when expected window-focus
[INFO] [4,2273] PASS: window-focus fired
[INFO] [4,2741] PASS: textfield-click fired
[ERROR] [29,2770] FAIL: window-click fired when expected textfield-focus

Associated Helpdesk Ticket

http://developer.appcelerator.com/helpdesk/view/67111">http://developer.appcelerator.com/helpdesk/view/67111

Attachments

FileDateSize
app.js2011-04-15T03:33:02.000+00002405

Comments

  1. Paul Dowsett 2012-01-16

    Reassigning to ios component, as it was incorrectly set.
  2. Junaid Younus 2012-05-14

    Tested with 2.0.1GA2 and got the following result: iOS simulator: [INFO] PASS: window-focus fired [ERROR] FAIL: Skipped expected textfield-click [INFO] PASS: textfield-focus fired Samsung Galaxy S2 (2.3.6): INFO/TiAPI(14291): PASS: window-focus fired ERROR/TiAPI(14291): FAIL: Skipped expected textfield-click INFO/TiAPI(14291): PASS: textfield-focus fired I'm not sure if the 'expected textfield-click' should fail or not, therefore I haven't closed this ticket. Please review and take appropriate actions.
  3. Olga Romero 2012-08-28

    Verified fix with: Titanium Studio, build: 2.1.2.201208201549 Titanium SDK: 2.1.2.v20120824144611 Devices: iPhone 4.3.5 GalaxyS3 4.0.4

JSON Source