{ "id": "136144", "key": "TIMOB-18500", "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": [ { "id": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-11-13T23:55:32.000+0000", "created": "2014-09-05T11:16:43.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "TCSupport" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" }, { "id": "16676", "description": "Release 3.4.1", "name": "Release 3.4.1", "archived": false, "released": true, "releaseDate": "2014-11-14" }, { "id": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" } ], "issuelinks": [ { "id": "56003", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "81917", "key": "TIMOB-6857", "fields": { "summary": "Android: UI - the back hardware button triggers optionDialog's click event", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56004", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "84237", "key": "TIMOB-6901", "fields": { "summary": "API: UI - provide optionDialog cancel event for when no button is selected", "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": "Low", "id": "4" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "mchen", "key": "mchen", "displayName": "Maggie Chen", "active": true, "timeZone": "Asia/Singapore" }, "updated": "2017-11-17T01:32:45.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": "h4. Problem Description\r\nWhen using optionDialog on android the click event returns depending on buttons vs options being clicked.\r\n\r\neven.cancel is true when the cancel button is clicked, however it also gets set to true when the option with same index is clicked or an additional test for event.button needs to be performed. Really this should happen at the SDK level.\r\n\r\n\r\n\r\nh4. Steps to reproduce\r\n1. Create a new mobile project (Ti Classic)\r\n2. Add this to app.js:\r\n{code} \r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n exitOnClose: true,\r\n});\r\n\r\nvar opts = {\r\n title: 'Delete File?'\r\n};\r\n\r\nvar isAndroid = Ti.Platform.osname == 'android';\r\n\r\nif(isAndroid){\r\n opts.options = ['Confirm', 'Cancel'];\r\n opts.buttonNames = ['Help'];\r\n //opts.Help = 0;\r\n} else {\r\n opts.options = ['Confirm', 'Help', 'Cancel'];\r\n}\r\n\r\nvar dialog;\r\nwin.addEventListener('click',function(){\r\n dialog = Ti.UI.createOptionDialog(opts);\r\n dialog.show();\r\n dialog.addEventListener('click', onSelectDialog);\r\n});\r\n\r\nfunction onSelectDialog(event){\r\n\tif(isAndroid){\r\n // event.button===true test is necessary \r\n if(event.button === true /*&& event.Help === true*/) alert(\"ok\");\r\n }\r\n //alert(\"ok\") ;\r\n}\r\n\r\nwin.open();\r\n{code}\r\n3. Run it in device. \r\n", "attachment": [], "flagged": false, "summary": "Android: event.cancel not set properly for optionsDialog", "creator": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "environment": " Ti SDK 3.2.3.GA and 3.3.0.GA\r\n Ti CLI 3.3.0\r\n Mac OS X 10.9.3\r\n Android 4.4.3", "closedSprints": [ { "id": 963, "state": "closed", "name": "2017 Sprint 22 SDK", "startDate": "2017-10-22T21:43:59.523Z", "endDate": "2017-11-05T22:43:00.000Z", "completeDate": "2017-11-06T16:33:42.425Z", "originBoardId": 114 }, { "id": 951, "state": "closed", "name": "2017 Sprint 20 SDK", "startDate": "2017-09-24T17:50:18.277Z", "endDate": "2017-10-08T17:50:00.000Z", "completeDate": "2017-10-09T20:38:07.840Z", "originBoardId": 114 }, { "id": 968, "state": "closed", "name": "2017 Sprint 23 SDK", "startDate": "2017-11-05T16:37:25.071Z", "endDate": "2017-11-19T16:37:00.000Z", "completeDate": "2017-11-20T18:57:56.565Z", "originBoardId": 114 }, { "id": 959, "state": "closed", "name": "2017 Sprint 21 SDK", "startDate": "2017-10-08T20:38:15.130Z", "endDate": "2017-10-22T20:38:00.000Z", "completeDate": "2017-10-24T23:55:56.605Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "428409", "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-25T15:00:07.000+0000", "updated": "2017-09-25T15:00:07.000+0000" }, { "id": "430373", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nWaiting for merge to get enabled.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-10T01:47:53.000+0000", "updated": "2017-11-10T01:47:53.000+0000" }, { "id": "430563", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-13T23:55:28.000+0000", "updated": "2017-11-13T23:55:28.000+0000" }, { "id": "430684", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Changes are seen in SDK 7.0.0.v20171114203226. Need to wait for CR to be completed before closing.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-15T07:33:15.000+0000", "updated": "2017-11-15T07:33:15.000+0000" }, { "id": "430891", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 7.0.0.v20171116132144.\r\n\r\nClosing.\r\n\r\nStudio Ver: 5.0.0.201711161920\r\nSDK Ver: 7.0.0.v20171116132144\r\nOS Ver: 10.12.3\r\nXcode Ver: Xcode 8.3.3\r\nAppc NPM: 4.2.11-2\r\nAppc CLI: 7.0.0-master.27\r\nTi CLI Ver: 5.0.14\r\nAlloy Ver: 1.10.9\r\nNode Ver: 8.9.1\r\nJava Ver: 1.8.0_101\r\nDevices: ⇨ google Pixel --- Android 7.1.1\r\n ⇨ google Nexus 5 --- Android 6.0.1\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-17T01:32:21.000+0000", "updated": "2017-11-17T01:32:21.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }