[TIMOB-2199] Button Click Event Object Missing X & Y coords on iPhone
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2012-07-26T11:30:51.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Steve Day |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:13:18.000+0000 |
Updated | 2012-07-26T21:44:50.000+0000 |
Description
Titanium Developer (v1.2.1) - SDK version: 1.4.1.1
The Event object on the Button click event does not appear to contain much information on the iPhone. It appears to work correctly on the Android side.
Appears to be similar to https://developer.appcelerator.com/question/8431/click-event-on-an-imageview-doesnt-work"> https://developer.appcelerator.com/question/8431/click-event-on-an-...
~~~ var btn1 =
Titanium.UI.createButton({image:'images/1.png',left:5,top:200,width:48,height:48,canScale:true});
btn1.addEventListener('click',function(e) {
txtInput.value+="1";
Titanium.API.debug("globalPoint:[" + e.globalPoint + "]");
Titanium.API.debug("source:[" + e.source + "]");
Titanium.API.debug("type:[" + e.type + "]");
Titanium.API.debug("x:[" + e.x + "]");
Titanium.API.debug("y:[" + e.y + "]");
});
win1.add(btn1);
~~~
OUTPUT SHOWS:
iPhone
~~~ [DEBUG] globalPoint:[undefined] [DEBUG] source:[[object TiUIButton]]
[DEBUG] type:[click] [DEBUG] x:[undefined] [DEBUG] y:[undefined] ~~~
Android
~~~ [DEBUG] [69,12017] globalPoint:[undefined]
[DEBUG] [11,12028]
source:[ti.modules.titanium.ui.ButtonProxy@44fd77c0] [DEBUG] [1,12029] type:[click] [DEBUG] [8,12037] x:[13] [DEBUG] [11,12048] y:[11.66668701171875]
~~~
Also, when I try to access globalPoint.x (maybe I don't know how to access it correctly) but it gets an access violation. It seems to me that it is not getting populated/created on either device.
I forgot to add the version info.
Titanium Developer (v1.2.1)
[INFO] Titanium SDK version: 1.4.1.1
Cannot reproduce in SDK 2.2.0.014b86f on iPhone Sim 5.1. Test: