[TIMOB-24052] Android: Event-listeners in Ti.UI.TextArea not working when editable = false (Regression)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-10-24T19:31:58.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.0.0 |
Components | Android |
Labels | regression, sdk-5.4, textArea |
Reporter | Dharshana Jayamaha |
Assignee | Gary Mathews |
Created | 2016-09-13T02:58:12.000+0000 |
Updated | 2016-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 '
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.
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.
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.
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._
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.
master: https://github.com/appcelerator/titanium_mobile/pull/8533
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.
It'll get into 6.0.0. Thanks!
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