{ "id": "162281", "key": "TIMOB-23887", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-05-09T18:06:06.000+0000", "created": "2016-07-30T11:15:01.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "merge-6.1.0" ], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [ { "id": "54837", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "148987", "key": "TIMOB-19247", "fields": { "summary": "iOS: handleLinks for TextArea doesn't work in ListItem templates", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-10T16:14:41.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": "I use non-editable textarea's for multi-line text sections in my app. For setting the value I use attributed strings because some parts are links. Visually the clickable parts look like they are processed correctly because they turn blue and underlined. But when I click on one of the links I expect the 'link' event to be triggered but all it does is select the word I just clicked, the listener get's nothing.\r\n\r\nWhen replacing textarea with label the link event works fine. Unfortunately labels are not an option for me because they do not handle Ti.UI.ATTRIBUTE_BASELINE_OFFSET, which I use to create a better looking line sacing, very well. Using that attribute on a label makes the it clip the text or unwanted ellipsis. ", "attachment": [], "flagged": false, "summary": "iOS: Attributed string link on a TextArea doesn't fire link event", "creator": { "name": "yhanssens", "key": "yhanssens", "displayName": "youri hanssens", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "yhanssens", "key": "yhanssens", "displayName": "youri hanssens", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "392541", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Can uou share a sample test code that regenerates the issue. Also please update your ticket with effected SDK version and your platform information. We will look into your testcode. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-08-05T18:24:53.000+0000", "updated": "2016-08-05T18:24:53.000+0000" }, { "id": "395290", "author": { "name": "isseium", "key": "isseium", "displayName": "Issei Komatsu", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "isseium", "key": "isseium", "displayName": "Issei Komatsu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-05T02:12:46.000+0000", "updated": "2016-09-05T02:12:46.000+0000" }, { "id": "416648", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This problem is due to TIMOB-19165 . In this NSLinkAttributeName attribute is removed in order to fulfill the requirement of ticket. The UITextView recognize URL on basis of NSLinkAttributeName and delegates get called , which is handled by UITextView itself. So link event is not getting fired. \r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-03T10:15:57.000+0000", "updated": "2017-04-03T10:16:17.000+0000" }, { "id": "416713", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "There are two solutions - \r\n1. Revert changes of TIMOB-19165 then UITextView's native link recognizer will be called.\r\n2. Made changes similar to UILabel's link recognizer which is custom.\r\n\r\nIn this PR, I have followed solution 2.\r\n\r\nPR: https://github.com/appcelerator/titanium_mobile/pull/8923\r\n\r\nTest Case :\r\n\r\n{code:java}\r\n// With padding\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor: '#ddd',\r\n});\r\n\r\nvar string = Ti.UI.createAttributedString({\r\n text: 'Appcelerator always give blue and underlined',\r\n attributes: [{\r\n type: Ti.UI.ATTRIBUTE_LINK,\r\n value: 'http://www.appcelerator.com',\r\n range: [0, 12]\r\n }, {\r\n type: Ti.UI.ATTRIBUTE_FOREGROUND_COLOR,\r\n value: 'red',\r\n range: [0, 12]\r\n }, {\r\n type: Ti.UI.ATTRIBUTE_UNDERLINES_STYLE,\r\n value: Ti.UI.ATTRIBUTE_UNDERLINE_STYLE_NONE,\r\n range: [0, 12]\r\n }, {\r\n type: Ti.UI.ATTRIBUTE_LINK,\r\n value: 'https://www.youtube.com',\r\n range: [25, 4]\r\n }]\r\n});\r\n\r\nvar textarea = Ti.UI.createTextArea({\r\n top: 100,\r\n attributedString: string,\r\n padding: {\r\n left: 20,\r\n right: 10\r\n }\r\n});\r\n\r\nwin.add(textarea);\r\nwin.open();\r\n\r\ntextarea.addEventListener(\"link\", function(e) {\r\n Ti.API.info('link clicked');\r\n win.add(Titanium.UI.createWebView({\r\n url: e.url,\r\n height: 300,\r\n width: 300\r\n }));\r\n});\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-04T06:51:27.000+0000", "updated": "2017-04-04T06:51:27.000+0000" }, { "id": "418997", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Backport for 6.1.0 please", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-03T07:31:01.000+0000", "updated": "2017-05-03T07:31:01.000+0000" }, { "id": "419078", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backport PR (6_1_X):https://github.com/appcelerator/titanium_mobile/pull/9013", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-04T04:13:18.000+0000", "updated": "2017-05-04T04:13:18.000+0000" }, { "id": "419380", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, using:\r\nMacOS 10.12 (16A323)\r\nStudio 4.9.0.201704061825\r\nTi SDK 6.1.0.v20170503211832\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.0\r\nAlloy 1.9.11\r\nXcode 8.3.2 (8E2002)\r\n\r\nAttributed strings, inside non-editable text areas, with links now correctly fire the link event when clicked. Tested using the sample code and modified it to fully apply to the test case.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-05-09T18:06:06.000+0000", "updated": "2017-05-09T18:06:06.000+0000" }, { "id": "419471", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Fixes verified in builds:\r\n6.1.0.v20170509170935\r\n6.2.0.v20170510084833", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-05-10T16:14:41.000+0000", "updated": "2017-05-10T16:14:41.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }