{ "id": "81917", "key": "TIMOB-6857", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-01-03T05:52:50.000+0000", "created": "2011-10-25T06:48:23.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "56003", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "136144", "key": "TIMOB-18500", "fields": { "summary": "Android: event.cancel not set properly for optionsDialog", "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" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "14360", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "83510", "key": "TIMOB-6859", "fields": { "summary": "Android: UI - optionDialog click event fired and index contains strange value when back button pressed", "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" } }, "priority": { "name": "Trivial", "id": "5" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "updated": "2018-01-03T05:52:50.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2. Problem\r\n\r\nThe Android back hardware button triggers optionDialog's click event. The click event shouldn't be triggered because of the fact dialog isn't clicked/touched with finger (back button is).\r\n\r\nh2. Test case\r\n\r\n* run code below\r\n* click on the button so that optionDialog shows\r\n* hit the hardware back-button. You'll see that this triggers dialog's click event.\r\n\r\n{code:lang=javascript|title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n modal: true,\r\n backgroundColor: '#000'\r\n});\r\n \r\nvar button = Ti.UI.createButton({\r\n title: 'Open dialog'\r\n});\r\n \r\nbutton.addEventListener('click', function() {\r\n \r\n var dialog = Ti.UI.createOptionDialog({\r\n options: ['Option 1', 'Option 2', 'Option 3'],\r\n title: 'Options'\r\n });\r\n \r\n dialog.addEventListener('click', function(e) {\r\n Ti.API.info('Dialog click event!');\r\n Ti.API.debug(e);\r\n });\r\n \r\n dialog.show();\r\n});\r\n \r\nwin.add(button);\r\n \r\nwin.open();\r\n{code}\r\n\r\nh3. Results\r\n\r\n{code}\r\nDialog click event!\r\n{\"cancel\":false,\"index\":-268435457,\"source\":{\"size\":{\"height\":0,\"width\":0},\"children\":[],\"height\":0,\"width\":0,\"center\":{\"y\":0,\"x\":0},\"options\":[\"Option 1\",\"Option 2\",\"Option 3\"],\"title\":\"Options\",\"keepScreenOn\":false,\"_events\":{}},\"button\":true,\"type\":\"click\"}\r\n{code}\r\n\r\nh2. Discussions\r\n\r\nSee [this Q&A question|http://developer.appcelerator.com/question/127291/android-back-button-triggers-option-dialogs-click-event].\r\n", "attachment": [], "flagged": false, "summary": "Android: UI - the back hardware button triggers optionDialog's click event", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* Titanium SDK version: 1.8.0.1 (12/20/11 19:01 f3575f8)\r\n* v8 runtime\r\n* Android 3.1\r\n* Lenovo Thinkpad tablet\r\n* Windows XP", "comment": { "comments": [ { "id": "177103", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Ivan, thank you for raising this ticket. Please note the changes I made to bring it in line with the [JIRA Ticket Checklist|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist].\r\n\r\nUnfortunately we cannot accept more than one issue or request in a single ticket. Would you raise an new feature request ticket for the following, if you still think it is valid?\r\n\r\nCheers\r\n\r\n{code}\r\nAlso, in my opinion, \"cancel\" functionality of optionDialog could be redesigned, so that is supports new \"cancel\" event instead of \"cancel\" property in \"click\" event as implementation of functionality when no option is selected. That way, we will be able to do action when both \"cancel\" option is selected and hardware back-button is pressed, and on the other hand in \"click\" event we won't have to check if \"cancel\" opinion was clicked to do no action (so, \"cancel\" option would not produce \"click\" event).\r\n{code}", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-12-23T03:39:25.000+0000", "updated": "2011-12-23T03:39:25.000+0000" }, { "id": "420460", "author": { "name": "p.saamy@gmail.com", "key": "p.saamy@gmail.com", "displayName": "saamy", "active": true, "timeZone": "America/Havana" }, "body": "May I know why this simple issue is not fixed yet ?", "updateAuthor": { "name": "p.saamy@gmail.com", "key": "p.saamy@gmail.com", "displayName": "saamy", "active": true, "timeZone": "America/Havana" }, "created": "2017-05-25T18:59:12.000+0000", "updated": "2017-05-25T18:59:12.000+0000" }, { "id": "428453", "author": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/9476", "updateAuthor": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "created": "2017-09-26T05:41:05.000+0000", "updated": "2017-09-26T05:41:05.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }