You found a bug! We've classified it as EXTJS-10998 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
    fedevegili is on a distinguished road

      0  

    Default Menu item icon doesn't resize

    Menu item icon doesn't resize



    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.2.1.883
    Browser versions tested against:
    • Chrome 28.0.1500.95 m
    Description:
    • While updating from Ext 4.1.1 to Ext 4.2.1.883 I noticed that menu item icons used to be rendered as a <img> but they've changed it to a <div> and set the img as a background-image. That's the css being applied to the icon:
    .x-menu-item-icon {
    width: 16px;
    height: 16px;
    top: 4px;
    left: 3px;
    background-position: center center; }

    The problem here is that background-images don't respect width and height attributes. I know that I could change the width and height to background-size but it would cause problem on multiple icon images and most versions of IE.

    Steps to reproduce the problem:
    • Just see test case.
    The result that was expected:
    • The icon being resized to 16x16.
    The result that occurs instead:
    • The icon doesn't get any resizing.
    Test Case:

    Just try this code in both versions:

    http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.menu.Item
    http://docs.sencha.com/extjs/4.1.1/#!/api/Ext.menu.Item

    Code:
    Ext.create('Ext.menu.Menu', {    width: 100,
        height: 50,
        floating: false,
        renderTo: Ext.getBody(),
        items: [{
            text: 'icon item',
            icon: 'http://docs.sencha.com/extjs/4.2.1/resources/images/print.png' /* 32x32 image */
        }]
    });


    HELPFUL INFORMATION

    Possible fix:
    • Change the attribute tag back to image instead of div.
    Operating System:
    • Win7 64bits

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    3,831
    Vote Rating
    72
    Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

Thread Participants: 1