Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24052] Android: Event-listeners in Ti.UI.TextArea not working when editable = false (Regression)

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-10-24T19:31:58.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0
ComponentsAndroid
Labelsregression, sdk-5.4, textArea
Reporter Dharshana Jayamaha
AssigneeGary Mathews
Created2016-09-13T02:58:12.000+0000
Updated2016-10-25T01:30:30.000+0000

Description

previously using Ti SDK 5.3 bellow code execute as expected
        var message = Ti.UI.createTextArea({
	    	editable : false,
	    	width: Ti.UI.SIZE,
	        height: Ti.UI.SIZE,
	        scrollable : false,
	    });
	    
	    message.addEventListener('click', function(){
	    	console.log("Message Clicked");
	    });
from Ti SDK 5.4 'click' event or 'longpress' or any event listener is not working unless I remove 'editable : false,' from text ares. expected behaviour :: Textares event listeners should work even Textarea object define as 'editable : false '

Comments

  1. Joe Falcone 2016-09-22

    Seeing the same with 5.5 SDK. One workaround that I'm using is that I happen to be putting the textArea into a container view so I set touchEnabled = false for the textArea and I set the eventListener on the container view. That avoids the ugly look of having a cursor show up in the textArea.
  2. Sharif AbuDarda 2016-10-07

    Hello, I have tested the issue. I wasn't able to reproduce the issue with the below code. The click event works fine in textarea.
       var win = Ti.UI.createWindow({
           backgroundColor : 'white'
       });
       var textArea = Ti.UI.createTextArea({
           borderWidth : 2,
           borderColor : '#bbb',
           borderRadius : 5,
           color : '#888',
           font : {
               fontSize : 20,
               fontWeight : 'bold'
           },
           keyboardType : Ti.UI.KEYBOARD_NUMBER_PAD,
           returnKeyType : Ti.UI.RETURNKEY_GO,
           textAlign : 'left',
           value : 'I am a textarea',
           top : 60,
           width : 300,
           height : 70
       });
       win.add(textArea);
       textArea.addEventListener('click', function() {
       
           console.log("Message Clicked");
       
       });
       
       win.open(); 
       
    I am testing on Operating System Name = Mac OS X Version = 10.11.6 Architecture = 64bit # CPUs = 4 Memory = 8589934592 Node.js Node.js Version = 4.2.2 npm Version = 2.14.7 Titanium CLI CLI Version = 5.0.9 Titanium SDK SDK Version = 5.5.1.GA Target Platform = Android 6.0.1 (Galaxy j7 device). It's not a valid bug. Thanks.
  3. Joe Falcone 2016-10-07

    Hi Sharif, Well, not exactly, you missed the major point of this problem. You did NOT set the *editable* property to FALSE. Had you done that, you would have found that the textArea does NOT respond to click events. That was in the original report and your code does not do that. _from Ti SDK 5.4 'click' event or 'longpress' or any event listener is not working unless I remove 'editable : false,' from text areas._
  4. Sharif AbuDarda 2016-10-19

    Hello, This is a valid bug. TextArea click event does not work when editable is set to false. I can reproduce the issue in Android 6.0.1 Device.
  5. Gary Mathews 2016-10-24

    master: https://github.com/appcelerator/titanium_mobile/pull/8533
  6. Christopher Williams 2016-10-24

    Merged to master (6.1.0), cherry-picked to 6_0_X. Not sure if that means it'll get into 6.0.0 GA or a 6.0.1 when/if we do one.
  7. Chee Kiat Ng 2016-10-24

    It'll get into 6.0.0. Thanks!
  8. Lokesh Choudhary 2016-10-25

    Verified the fix. EventListeners for TextArea work when editable is set to false. Closing. Appc Studio : 4.8.0.201610171310 SDK Version : 6.0.0.v20161024145110 Mac OS Version : 10.11.6 Xcode Version : Xcode 8.0 Build version 8A218a Appc CLI AND Appc NPM : {"NPM":"4.2.8-9","CLI":"6.0.0-64"} Ti CLI : 5.0.10 Alloy : 1.9.3 Node : v4.6.0

JSON Source