TextFieldAutoSize still doesn't work in HTML5

label_field.autoSize = TextFieldAutoSize.RIGHT;
label_field.text = “Test”;
trace(label_field.autoSize,label_field.width,label_field.textWidth);

The textfield is a child of a Sprite and stored in a swf file.

The trace show that the autosize is set to the desired value, but the width of the textfield does not change even though it’s not close to textWidth. Tried different settings on the textfield, including different widths and justification settings. None of that made any difference.

The Feature Matrix shows that autosize is supported in HTML5.

Anyone know how to make autosize work?

I haven’t tried TextFieldAutoSize.RIGHT, but TextFieldAutoSize.LEFT definitely works for me in HTML5. I wouldn’t be able to create Feathers UI without this feature.

One thing to watch out for is that setting the width property to a specific value causes autoSize to start changing the height instead of the width. This is the behavior as designed, but it might not necessarily be intuitive.

Another thing to watch out for is to make sure the textfield’s multiline (and wordWrap, for that matter) property is set to false. If it is set to true, it’ll resize the height instead of the width.

I have lost several hours to this very reason while messing with text in past projects.