Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23835] Android: TextField's focusable property does not take effect after setting it to false once.

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-12-12T16:38:12.000+0000
Affected Version/sRelease 5.4.0, Release 5.3.1
Fix Version/sn/a
Componentsn/a
LabelsAndroid, TextField, Titanum, focusable
ReporterPrashant Saini
AssigneeShak Hossain
Created2016-07-22T07:00:37.000+0000
Updated2016-12-12T16:38:12.000+0000

Description

*index.xml*
<Alloy>
	<Window backgroundColor="black">
	    <TextField left="20" right="20" color="white" backgroundColor="#aaa" borderWidth="1" borderColor="white" id="OTHER_FIELD" hintText="Focus + Edit" />
	    
	    <Button onClick="noFocusNoEdit" bottom="70">No-FOCUS + No-EDIT</Button>
	    <Button onClick="focusEdit" bottom="20">FOCUS + EDIT</Button>
	</Window>
</Alloy>
*index.js*
function noFocusNoEdit() {
    $.OTHER_FIELD.focusable = false;
    $.OTHER_FIELD.editable = false;
    $.OTHER_FIELD.hintText = 'No-Focus + No-Edit';
}

function focusEdit() {
    $.OTHER_FIELD.focusable = true;
    $.OTHER_FIELD.editable = true;
    $.OTHER_FIELD.hintText = 'Focus + Edit';
}

$.index.open();

Attachments

FileDateSize
environment.txt2016-08-29T09:04:28.000+000013485

Comments

  1. Prashant Saini 2016-07-22

    I was expecting that TextField will regain focus on setting focusable=true, but it did not. I need to do this setting to reset the TextField underline color to default grey, which turns to Android theme color on focus. editable property works as expected.
  2. Prashant Saini 2016-08-29

    This is my environment information in text file. Ti SDK used in that code is 5.3.1.GA and 5.4.0.GA as well.
  3. Sharif AbuDarda 2016-12-12

    Hello, I have tested hte issue with SDK 6.0.0.GA. The issue is not reproducible there. Verified fix:
       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.10
       
       Titanium SDK
         SDK Version                 = 6.0.0.GA
         SDK Path                    = /Users/gsl001/Library/Application Support/Titanium/mobile
       sdk/osx/6.0.0.GA
         Target Platform             = android 6.0.0
       

JSON Source