PDA

View Full Version : [OPEN-1396] [3.3.0] CompositeField: does not adjust for auto grow textarea.



dongryphon
7 Nov 2010, 9:37 PM
Ext version tested:

Ext 3.3


Adapter used:

ext


css used:

only default ext-all.css
custom css ux-all.css




Browser versions tested against:

IE8
FF3.6.12 (firebug 1.5.4 installed)


Operating System:

Win 7


Description:

CompositeField does not adjust for auto grow textarea.


Test Case:



{
xtype: "composite",
items:
[
{ xtype: "textarea", grow: 4 },
{ xtype: "textfield" }
]
}

Steps to reproduce the problem:

Place an auto grow textarea in a composite field.
Type into the textarea.


The result that was expected:

The composite field should grow.


The result that occurs instead:

The inner textarea grows, but the composite does not.


Debugging already done:

The autosize event of the textarea is fired, but the composite is not listening.


Possible fix:


(function (C) {
Ext.override(C, {
onRender: C.prototype.onRender.createSequence(function () {
this.eachItem(function(item) {
if (item.grow) {
item.on("autosize",
function (c) {
var ct = c.ownerCt;
if (ct)
ct.doLayout();
});
}
});
})
});

})(Ext.form.CompositeField);