Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10145] Android: textField - clearOnEdit does not seem to function

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-01-26T18:22:41.000+0000
Affected Version/sRelease 2.0.1, Release 2.1.1, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi, parity, qe-and070112
ReporterEric Merriman
AssigneeEric Merriman
Created2012-07-25T16:04:54.000+0000
Updated2017-01-26T18:22:41.000+0000

Description

Description: While testing KitchenSink in the textfield area, We attempted to use "the rest" test and the test for "clearOnEdit" did not clear text from the field when the property was set. This is not a regression, this occurs with 2..0.1GA2 as well. Steps to reproduce: 1) Launch KitchenSink, navigate to Controls > TextField > the rest 2) enter text into the text field 3) manipulate the "clear on edit" button until the desired result is achieved (3 presses, first logs in console "undefined", second, "true", third "false" which is actually true) 4) Attempt to edit text again Result: the existing text remains Expected: The existing text is removed on field entry

Comments

  1. Shameer Jan 2013-03-04

    the problem can reproduce with release 3.0.2 and master 3.1.0 tested on:Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4
  2. Michael Gangolf 2017-01-25

    Already working. Text gets cleared on entering the textfield: * SDK: 6.0.1.GA * Android 6.0.1 * HTC A9 *Test code:*
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff',
           layout:"vertical"
       });
       
       var tf = Ti.UI.createTextField({
           clearOnEdit: true,
           borderWidth: 1,
           color: "#000",
           borderColor: "#000",
           left: 10,
           right: 10,
           value: "asdfasdfasfd"
       })
       var tf2 = Ti.UI.createTextField({
           clearOnEdit: true,
           borderWidth: 1,
           color: "#000",
           borderColor: "#000",
           left: 10,
           right: 10,
           value: "asdfasdfasfd"
       })
       var tf3 = Ti.UI.createTextField({
           clearOnEdit: true,
           borderWidth: 1,
           color: "#000",
           borderColor: "#000",
           left: 10,
           right: 10,
           value: "asdfasdfasfd",
           passwordMask:true
       })
       
       win.add(tf);
       win.add(tf2);
       win.add(tf3);
       
       win.open();
       
       
    Related code: https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java#L404
  3. Eric Merriman 2017-01-26

    Thanks [~michael]
  4. Samir Mohammed 2017-01-26

    Using the test case provided by [~michael] I can verify that text does get cleared when clicking into a textfield. *Steps taken to verify:* 1. Clicked into a textfield which already had existing text 2. Textfield is cleared 3. Entered text in to the textfield 4. Clicked away from the textfield 5. Clicked back into the textfield 6. Textfield is cleared *Environement*
       Appcelerator Command-Line Interface, version 6.1.0
       Nexus 6p (Android 7.1)
       Operating System Name: Mac OS X El Capitan
       Operating System Version: 10.11.6
       Node.js Version: 4.6.0
       npm: 4.2.8
       Titanium SDK Version: 6.1.0.v20170124122351
       Titanium SDK Version: 6.0.2.v20170123140026
       Xcode: 8.2
       Appcelerator Studio: 4.8.1.201612050850
       

JSON Source