PDA

View Full Version : [3.3.1] Fix (initial) size of Ext.form.TextArea with grow enabled



uwolfer
5 Jan 2011, 10:11 AM
If i enable the grow option in a TextArea with much text inside, the TextArea is very large (height) initially (tested in a Panel with a form layout). It resizes when I click into it or change the value by keyboard. After a little debugging, I have found the issue: the text-size-element does not resize after the onResize event of the field. The following override fixes this issue.


Ext.override(Ext.form.TextArea, {
onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){
Ext.form.TextArea.superclass.onResize.call(this, adjWidth, adjHeight, rawWidth, rawHeight);
this.autoSize();
}
});

uwolfer
22 Jan 2011, 7:19 AM
Bump.

uwolfer
13 Dec 2011, 1:20 AM
The following fix works fine with 3.4.0:


Ext.override(Ext.form.TextArea, {
onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){
Ext.form.TextArea.superclass.onResize.call(this, adjWidth, adjHeight, rawWidth, rawHeight);
this.autoSize();
},


setValue : function(v) {
Ext.form.TextArea.superclass.setValue.call(this, v);
var that = this;
(function() {
that.autoSize();
}).defer(1);
}
});