Results 1 to 2 of 2

Thread: Menu item icon doesn't resize

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default 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
    9,780
    Vote Rating
    258
      0  

    Default

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

Posting Permissions

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