3.2.0

Possible setSize() Bug in AW 2.5.2 & FF2?

Hi,

It seems that setSize() behaviour has changed in the new version of AW for FF2.

The following code:

var but = new AW.UI.Button;
but.setSize(10,10);
alert( "width=" + but.getStyle("width") +", height=" + but.getStyle("height") );


in AW 2.5.1 & IE6/FF2, produces:
"width=2px, height=6px"

AW 2.5.2/IE6 also produces:
"width=2px, height=6px"

but AW 2.5.2/FF2 results in:
"width=undefined, height=6px"

Is this a bug, or should I be reading the width in a different manner?

(It is odd that there are 'setSize()/setPosition()' methods, but no complementary 'getters'. Or am I missing something?)

Cheers!
Diarmuid
July 3,
This is actually a bug fix - the intention is to allow the button to grow in the horizontal direction when the text content is longer than the requested width. For this reason AW 2.5.2 sets width style attribute in IE and min-width in other browsers. This way the behavior is consistent across all browsers.

This behavior is activated only when 'text' class value is 'expand' (which is default value for AW.UI.Button). You can switch it off with

obj.setClass('text', 'normal');

The code is located in /source/lib/ui/imagetext.js, line 118
Alex (ActiveWidgets)
July 3,
Cheers Alex,
The information is much appreciated! :)
Diarmuid
July 4,

This topic is archived.

See also:


Back to support forum