Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4748] Programmatically focusing a TextArea does not work properly

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-10-27T14:50:46.000+0000
Affected Version/sn/a
Fix Version/sSprint 2011-30, Release 1.8.0
ComponentsiOS
Labelsn/a
ReporterReggie Seagraves
AssigneeBlain Hamon
Created2011-07-22T10:59:01.000+0000
Updated2011-10-27T14:50:52.000+0000

Description

This bug originated in an email from Nolan; Doing a programmatic focus like this does not work text.addEventListener('click', function(){ var ta1 = Titanium.UI.createTextArea({ height:300, width:500, top:70, font:{fontSize:40,fontFamily:'AppleColorEmoji'}, color:'#888', textAlign:'left', borderWidth:1, borderColor:'#bbb', borderRadius:10, }); Create.window.add(ta1); ta1.focus(); }); I have to do this (wrap it in a setTimeout). We need a test and a JIRA for this. text.addEventListener('click', function(){ var ta1 = Titanium.UI.createTextArea({ height:300, width:500, top:70, font:{fontSize:40,fontFamily:'AppleColorEmoji'}, color:'#888', textAlign:'left', borderWidth:1, borderColor:'#bbb', borderRadius:10, }); Create.window.add(ta1); setTimeout(function(){ ta1.focus(); },4); });

Comments

  1. Blain Hamon 2011-07-26

    Sample code to test:
       var parent = Ti.UI.createWindow();
       var openNewChildButton = Ti.UI.createButton({ title: 'Start' });
       parent.add(openNewChildButton);
       
       openNewChildButton.addEventListener('click', function(){
       var ta1 = Titanium.UI.createTextArea({height:100,width:300,
       top:20,font:{fontSize:40,fontFamily:'AppleColorEmoji'},
       color:'#888',textAlign:'left',borderWidth:1,borderColor:'#bbb',
       borderRadius:10,});
       parent.add(ta1);
       ta1.focus();
       });
       
       parent.open();
       
  2. Blain Hamon 2011-07-26

    Pull request 291 submitted.
  3. Alan Vaghti 2011-08-29

    Passed as expected on: iPod 3rd Gen 4.0.2 iPad 2 4.3.2 iPhone 4 4.2.10 SDK: version=1.8.0 timestamp=08/26/11 14:53 githash=8e978eb...

JSON Source