You found a bug! We've classified it as TOUCH-4559 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    416
    Vote Rating
    18
    jweber will become famous soon enough

      0  

    Default Text field has clear icon when empty

    Text field has clear icon when empty


    REQUIRED INFORMATION


    Ext version tested:
    • Sencha Touch 2.2.1

    Browser versions tested against:
    • Chrome for Mac 27.0.1453.93

    DOCTYPE tested against:
    • html

    Description:
    • If you give a text field a value="" config, it will show the "x" icon, even though it's empty.

    Steps to reproduce the problem:
    • Load the example below.

    The result that was expected:
    • "x" icon doesn't appear.

    The result that occurs instead:
    • "x" icon doesn't appear.

    Test Case:

    Code:
    Ext.define('Main', {
    	extend: 'Ext.Container',
    	config: {
    		fullscreen: true,
    		items: [{
    			xtype: 'textfield',
    			placeHolder: 'field is empty',
    			value: ''
    		}]
    	}
    });
    
    var main = Ext.create('Main');


    HELPFUL INFORMATION


    Screenshot or Video:
    • N/A

    See this URL for live test case: N/A


    Debugging already done:
    • none

    Possible fix:
    • not provided

    Additional CSS used:
    • base theme

    Operating System:
    • Mac OS 10.8.4

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,547
    Vote Rating
    873
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Vancouver, BC, Canada
    Posts
    32
    Vote Rating
    3
    william.cheung is on a distinguished road

      0  

    Default


    Has this bug been fixed yet? If yes, in which build?

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Vancouver, BC, Canada
    Posts
    32
    Vote Rating
    3
    william.cheung is on a distinguished road

      0  

    Default


    We have found that if you fix Ext.field.Text as follows (in bold face), it will fix the issue:

    Code:
        
    // @private
    showClearIcon: function() {
        var me         = this,
            value      = me.getValue(),
            // allows value to be zero but not undefined or null (other falsey values)
            valueValid = value !== undefined && value !== null && value !== "";
    
        if (me.getClearIcon() && !me.getDisabled() && !me.getReadOnly() && valueValid) {
            me.element.addCls(Ext.baseCSSPrefix + 'field-clearable');
        }
    
        return me;
    },

Thread Participants: 2

Tags for this Thread