Results 1 to 5 of 5

Thread: Button textAlign Doesn't Work

  1. #1
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,790
    Vote Rating
    392
      0  

    Default Button textAlign Doesn't Work

    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:

    Code:
    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.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,644
    Vote Rating
    61
      0  

    Default

    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.
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,644
    Vote Rating
    61
      0  

    Default

    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.
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,790
    Vote Rating
    392
      0  

    Default

    According to the release notes this feature wasn't added till 4.0.4. It worked fine in 4.0.7.

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,644
    Vote Rating
    61
      0  

    Default

    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!
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •