[TIMOB-2923] iOS: Events don't bubble like they do on Android
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-05-21T10:00:17.000+0000 |
Affected Version/s | Release 1.6.0 |
Fix Version/s | Release 2.0.1 |
Components | iOS |
Labels | parity, qe-port |
Reporter | Dawson Toth |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:33:01.000+0000 |
Updated | 2012-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
File | Date | Size |
---|---|---|
app.js | 2011-04-15T03:33:02.000+0000 | 2405 |
Reassigning to ios component, as it was incorrectly set.
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.
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