Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3038] iOS clearOnEdit on textFiled clears value but retains info

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2012-05-22T21:02:23.000+0000
Affected Version/sn/a
Fix Version/sRelease 2.0.1
ComponentsiOS
Labelsmodule_textfield, qe-testadded
ReporterPedro Enrique
AssigneeNeeraj Gupta
Created2011-04-15T03:35:15.000+0000
Updated2012-08-13T13:29:41.000+0000

Description

Simple test:

var win = Titanium.UI.createWindow({
    backgroundColor:'#fff'
});

var field = Titanium.UI.createTextField({
    color:'#000',
    font:{fontSize:16,fontWeight:'bold', fontFamily:'Arial'},
    backgroundColor:'#fff',
    borderColor:'#000',
    value:'',
    height:50,
    top:10,
    clearOnEdit:true
});
var button = Ti.UI.createButton({top:100,width:200,height:50,title:'here'});
win.add(field);
win.add(button);

field.addEventListener('focus',function(e){
    alert('textfield value: '+e.value);
});

button.addEventListener('click',function(e){
    field.blur();
    alert('textfield value: '+field.value);
});


win.open();

To reproduce:
1. click on the text field and type something
2. click on the button to see the text field value
3. click on the text field again and the value is gone as expected (do not type anything)
4. click on the button again and you'll see the old text field's value

The alert on focus will show the value of the text field, which is gone on focus as expected, but mysteriously reappears afterwards.

HD ticket:
http://developer.appcelerator.com/helpdesk/view/69941">http://developer.appcelerator.com/helpdesk/view/69941

Ti SDK 1.6 (Feb 2 2011 15:24 ra02f7db3)
iPhone simulator 4.2

Comments

  1. Junaid Younus 2012-05-14

    Unable to reproduce using 2.0.1GA2 on the iOS simulator. Ticket closed.
  2. Kanat Asanbekov 2012-07-16

    Closing as fixed. Tested with: Titanium Studio, build: 2.1.1.201207121732 Titanium SDK: 2.2.0.v20120716092112 Devices: iPod Newton 4.3.5, iPhone 4S 5.1
  3. Kanat Asanbekov 2012-07-16

    For QE, use this code:
       var win = Titanium.UI.createWindow({
           backgroundColor:'#fff'
       });
       
       var field = Titanium.UI.createTextField({
           color:'#000',
           font:{fontSize:16,fontWeight:'bold', fontFamily:'Arial'},
           backgroundColor:'#fff',
           borderColor:'#000',
           value:'',
           height:50,
           width: 200,
           top:10,
           clearOnEdit:true
       });
       var button = Ti.UI.createButton({top:100,width:200,height:50,title:'here'});
       win.add(field);
       win.add(button);
       
       field.addEventListener('focus',function(e){
           alert('textfield value: '+e.value);
       });
       
       button.addEventListener('click',function(e){
           field.blur();
           alert('textfield value: '+field.value);
       });
       
       
       win.open();
       

JSON Source