{ "id": "89372", "key": "TIMOB-8490", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "10100", "description": "This issue won't be actioned.", "name": "Won't Do" }, "resolutiondate": "2020-01-10T18:03:19.000+0000", "created": "2012-04-02T14:38:49.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "reprod" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": null, "updated": "2020-01-10T18:03:19.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Found this bug when doing a FR of PR 1892 (TIMOB-7841).\r\nUse the code below to test.\r\nCurrent Behavior:\r\nLabel click event handler never gets called. But the button event handler always gets called when button is clicked.\r\n\r\nExpected behavior:\r\nLabel and button event handler should be called when label is clicked. Button event handler should be called when when button is clicked outside the label.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:\"white\"\r\n});\r\n\r\n\r\nvar button = Ti.UI.createButton({\r\n\twidth:200,\r\n\theight:200,\r\n\tenabled:true,\r\n\tbackgroundImage:\"blue.png\",\r\n\tbackgroundColor:\"red\"\r\n})\r\n\r\n\r\nvar btnLabel = Ti.UI.createLabel({\r\n\ttext:\"I am button\",\r\n\tbackgroundColor:\"green\"\r\n})\r\n\r\nbutton.add(btnLabel);\r\n\r\nbtnLabel.addEventListener('click',function(e){\r\n\tTi.API.info(\"LABEL CLICKED \"+e.source);\r\n})\r\n\r\nbutton.addEventListener('click',function(e){\r\n\tTi.API.info(\"BUTTON CLICKED \"+e.source);\r\n})\r\nvar btnstate = true;\r\n\r\nvar stateChange = Ti.UI.createButton({\r\n\ttitle:\"Click Me\",\r\n\twidth:Ti.UI.FILL,\r\n\theight:40,\r\n\tbottom:10\r\n})\r\n\r\nstateChange.addEventListener('click',function(){\r\n\tif (btnstate === true)\r\n\t{\r\n\t\tTi.API.info(\"Disabling Button\");\r\n\t\tbutton.setEnabled(false);\r\n\t\tbtnstate = false;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tTi.API.info(\"Enabling Button\");\r\n\t\tbutton.setEnabled(true);\r\n\t\tbtnstate = true;\r\n\t}\r\n})\r\n\r\nwin.add(button);\r\nwin.add(stateChange);\r\nwin.open();\r\n{code}", "attachment": [ { "id": "26780", "filename": "blue.png", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-04-02T14:38:49.000+0000", "size": 2133, "mimeType": "image/png" } ], "flagged": false, "summary": "IOS: Ti.UI.Button does not act as a true View group.", "creator": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "215050", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In looking into this, there is a difficult quandary on this. The issue is hitTest, which determines where the click event goes. Because the label has clickEnabled false by default.\r\n\r\nThe catch is that if this is fixed, this means that the label would suppress the button hilighting since it would steal the click event instead.\r\n\r\nProposal in the long run is to do away with button as a view group. It was a hideous hack to begin with due to some old iOS limitations, and now that you can modify the label and image views that are natively inside UIButton, we should do that instead.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-17T17:36:36.000+0000", "updated": "2012-08-17T17:36:36.000+0000" }, { "id": "245159", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces \n\nTested with\n\nTitanium Studio, build: 3.0.1.201212181159\nTitanium SDK version: 3.1.0 \nTitanium SDK version: 3.0.2 \niOS iPhone Simulator: iOS SDK version: 6.0\n", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-02T11:19:36.000+0000", "updated": "2013-04-02T11:19:36.000+0000" }, { "id": "422394", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue with the following environment;\r\niPhone 7 (10.2)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1.v20170620103414\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.1\r\nTi CLI 5.0.13\r\nAlloy 1.9.11\r\nArrow 2.0.0\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-20T20:44:01.000+0000", "updated": "2017-06-20T20:44:01.000+0000" }, { "id": "453642", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. \r\n\r\nIf community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-10T18:03:19.000+0000", "updated": "2020-01-10T18:03:19.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }