PDA

View Full Version : Button textAlign Doesn't Work



skirtle
24 Dec 2011, 7:12 AM
The button config setting textAlign no longer works. From a quick look at the code it seems that the bit that does this during rendering has been removed.

Test case:


Ext.create('Ext.button.Button', {
renderTo: Ext.getBody(),
text: 'Click',
textAlign: 'left',
width: 200
});

I don't want to sound all preachy but I'm a little concerned if this wasn't picked up by either an automated test or QA. It's not a subtle failure.

Animal
24 Dec 2011, 7:47 AM
Thanks for the early warning.

examples/button/button.html is fairly comprehensive, and is checked for visual correctness.

But I see now that it doesn't cover all cases.

I'll expand it to use text alignment with various icon options.

Animal
24 Dec 2011, 7:56 AM
It didn't appear to work in 4.0.2. I just added a textAlign: 'left' section to that test page and ran it under 4.0.2, and the alignment was center, so I think this is an old bug.

I'll get it fixed though.

skirtle
24 Dec 2011, 8:01 AM
According to the release notes this feature wasn't added till 4.0.4. It worked fine in 4.0.7.

Animal
24 Dec 2011, 8:21 AM
Well the code was there. I'd just made an error... It's getBtnClass that has to create a class name for the button element based upon the textAlign property.. Duh!