Results 1 to 7 of 7

Thread: [FIXED][2.x,3.x] TextField and TextArea width

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      0  

    Default [FIXED] [2.x,3.x] TextField and TextArea width

    The width of TextFields and TextAreas in IE 6, 7 and 8 and Opera is often calculated wrong.

    Try the following example in IE 6, 7 and 8 and Opera in both standard and quirks mode:
    Code:
    Ext.onReady(function(){
    	new Ext.Viewport({
    		layout: 'form',
    		items: [{
    			anchor: '0',
    			xtype: 'textfield',
    			fieldLabel: 'Label'
    		},{
    			anchor: '0',
    			xtype: 'textarea',
    			fieldLabel: 'Label'
    		}]
    	});
    });
    You'll notice that the width of the fields is almost always wrong and this can even cause the textarea to become invisible (in IE6) or shift down (in IE7).

    I did a thorough check of all browsers and found that this will fix all width problems:
    Code:
    Ext.override(Ext.form.Field, {
    	adjustWidth : function(tag, w){
    		if(typeof w == 'number' && !this.normalWidth && 
    			(Ext.isIE6 || !Ext.isStrict) && /input|textarea/i.test(tag) && !this.inEditor){
    			return w - 3;
    		}
    		return w;
    	}
    });
    (I have no idea why the original code was so complicated)

    ps. TextFields and TextAreas in IE8 also need these CSS additions:
    Code:
    .ext-strict .ext-ie8 .x-form-text, .ext-strict .ext-ie8 textarea.x-form-field {
    	margin-bottom: 1px;
    }
    .ext-gecko .x-form-text, .ext-ie8 .x-form-text {
    	padding-top: 2px;
    	padding-bottom: 0px;
    }

  2. #2
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    +1

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      0  

    Default

    Moved from the 2.x to the 3.x bugs section in the hope it will get more attention here...

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,383
    Vote Rating
    858
      0  

    Default

    Thanks for the report, I'll check it out.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,383
    Vote Rating
    858
      0  

    Default

    Condor, with your code I was getting differing results, for example try that override and your sample in Opera or FF in quirks and strict mode. Is the || isStrict in the condition meant to be like that?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,383
    Vote Rating
    858
      0  

    Default

    Seems to be the case, fixed in SVN.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Sencha User
    Join Date
    Aug 2013
    Posts
    1
    Vote Rating
    0
      0  

    Default

    thks,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •