Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18048] Android: Ti.UI.Label.html - setting html property makes it non-clickable

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2015-03-25T02:02:41.000+0000
Affected Version/sRelease 3.4.0, Release 3.4.1
Fix Version/sn/a
ComponentsAndroid
LabelsTSP, andorid, html, label, module_label, qe-manualtest, qe-testadded
ReporterManoj Kumar
AssigneeAshraf Abu
Created2014-11-17T12:28:09.000+0000
Updated2017-03-27T20:26:48.000+0000

Description

Problem Description

Once you set the html property in a label, the click event is lost.

Test Case

1. Create a new mobile project Classic titanium 2. Paste this code into app.js:
var win = Ti.UI.createWindow({
  backgroundColor: "#fff"
});
var lbl = Ti.UI.createLabel({
 backgroundColor: "red",
 html: "Click <b>here</b>    <a href=\"http://www.w3schools.com\">Visit W3Schools.com!</a>"
});
lbl.addEventListener("click", function(){
  alert("clicked");
});
win.add(lbl);
win.open();
3. Run it in a 4.0.x device. 4. Click the label

Expected results

After clicking the label, an alert should appear.

Actual results

alert is not shown.

Comments

  1. Shuo Liang 2014-11-18

    Problem can be reproduced on Titanium SDK 3.4.0.GA Android 2.3.6 SAMSUNG-SGH-I777
  2. Manoj Kumar 2014-11-18

    Seems this issue exists with 4.0 too. Reproduced on the following devices. 1. Galaxy S2 GT-i1900 - Android 4.0.3 2. Motorola MB526 - Android 2.3.4 But working fine with following devices, 1. Nexus 4 - Android 4.4.4 2. Galaxy S4 GT-I9500 - Android 4.4.2
  3. Ping Wang 2014-12-09

    PR: https://github.com/appcelerator/titanium_mobile/pull/6460
  4. Shannon Hicks 2014-12-09

    I would be careful when testing, and make sure that anchor tags in the html still click properly, too.
  5. Ping Wang 2014-12-10

    Added an anchor tag to the test case. For FR, please run the test case on pre-JB device and click the label to see the alert. If you click on the hyperlink inside the label, it will open the browser and go to that webpage.
  6. Lokesh Choudhary 2015-01-07

    Verified the fix. Click event works even after setting the labels html property. Closing Environment: Appc Studio : 3.4.1.201410281743 Ti SDK : 3.5.0.v20150106150919, 3.6.0.v20150106160923 CLI : 3.4.1 Alloy : 1.5.1 GA Code Processor : 1.1.1 MAC Yosemite : 10.10 Samsung Galaxy S3 - android 4.0.4
  7. Manojkumar Murugesan 2015-01-27

    ~lchoudhary, were you able to test this on android 2.3 (API level 10) and above devices. I tested with 3.5.0.GA and it fails.
  8. Lokesh Choudhary 2015-01-27

    Below is the matrix for the results on different android versions for this issue: ||SDK 3.6.0.v20150127082526|| Result|| |2.3.7| Alert is seen |4.0.4| Alert is seen |4.1.1| Alert is seen |4.3| Alert is seen |4.2.2| Alert is seen |4.4.4| No alert seen |5.0.1| No alert seen ||SDK 3.5.0.GA|| Result|| |2.3.7| No alert seen |4.0.4| No alert seen |4.1.1| Alert is seen |4.3| Alert is seen |4.2.2| Alert is seen |4.4.4| No alert seen |5.0.1| No alert seen Please note the fix version is "Release 3.6.0". Reopening the ticket as this issue is seen in android 4.4.4 & 5.0.1 when built with SDK 3.6.0.v20150127082526. Environment: Appc Studio : 3.4.1.201410281743 Ti SDK : 3.5.0.GA, 3.6.0.v20150127082526 CLI : 3.4.1 Alloy : 1.5.1 GA Code Processor : 1.1.1 MAC Yosemite : 10.10
  9. Ashraf Abu 2015-03-13

    Trying to reproduce this with 4.4.4 and 5.0.0 Android on master branch. So far, unable to reproduce.
  10. Ashraf Abu 2015-03-16

    Tried this with:- Master Branch 3.5.1.GA 3.5.0.GA 3.4.1.GA With the following Android OS: 4.4.2 Samsung Galaxy S 5 (SM-G900F) 4.4.4 Nexus 4 5.0 Nexus 9 Unable to reproduce. Able to click the label and get an alert. Also able to click the website link which opens the web browser.
  11. Ashraf Abu 2015-03-16

    [~lchoudhary] Are you still able to reproduce this?
  12. Lokesh Choudhary 2015-03-25

    [~msamah]I tried to reproduce the issue on the devices below with SDK 4.0.0.v20150323131014 & I am not able to see the issue: 1. Galaxy Nexus 4.2.2 - Alert is seen. 2. Samsung Galaxy S2 2.3.6 - Alert is seen. 3. Nexus 5 5.1- Alert is seen. Environment: Appc Studio : 4.0.0.201503232213 Ti SDK : 4.0.0.v20150323131014 CLI : 4.0.0-alpha Alloy : 1.6.0-alpha MAC Yosemite : 10.10.2
  13. Ashraf Abu 2015-03-25

    [~lchoudhary] I'll resolve this ticket as issue is not reproducible.
  14. Shuo Liang 2015-03-25

    Does it mean we fix it in Ti.SDK 4.0
  15. Ashraf Abu 2015-03-25

    This problem shouldn't be seen in Ti.SDK 4.0.
  16. Shuo Liang 2015-03-25

    Got it. Thanks
  17. Ingo Muschenetz 2015-03-26

    [~sdavenport] This was incorrectly assigned a fix version. That said, it may actually be fixed--we just can't reproduce it any more.
  18. Lee Morris 2017-03-27

    Closing ticket as I am unable to reproduce this issue with the following environment; Pixel (7.1) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80

JSON Source