View Full Version : Datefield is shrinked when rendered hidden

9 Mar 2011, 3:58 AM
Ext version tested:

Ext 3.3.0

Adapter used:


css used:

only default ext-all.css

Browser versions tested against:

FF3.6 (firebug 1.6.1 installed)

Operating System:

Windows 7


When the DateField (TriggerField) is rendered in background, its size is calculated incorrectly to be the size of the trigger button only. Source of the bug is in Ext.form.TriggerField::onResize() (< Ext.BoxComponent:: setSize() < Ext.BoxComponent::afterRender()). Instead of

this.wrap.setWidth(this.el.getWidth() + tw);
the following should be used:

because when the field is being rendered hidden, this.el.getWidth() is equal to zero, even though the width is "set" on previous line.

Test Case:

I'm sorry, but I don't have time to write a barebone test case. I found the bug while developing a large application (proprietary code) and after long debugging was surprised when I found that the bug is in Ext core, not in our code. If this report helps correcting the bug, nice. If not, pity :)

Debugging already done:

As described above.

Possible fix:

As described above.


And a sidenote: In Firefox 3.6 this forum doesn't work correctly. Clicking on 'Post New Thread' (or whatever the caption is) doesn't work and 'Preview' submits the post instead of showing preview.

29 Mar 2011, 8:54 AM
I recently ran it to this same problem. If I set the container's hideMode to 'offsets', any hide-related problems, including datefield, went away.