Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    6
    Vote Rating
    0
    DavidEichmann is on a distinguished road

      0  

    Default [4.0.2a] Large Ext.menu.Menu incorrectly shown (Possible fix)

    [4.0.2a] Large Ext.menu.Menu incorrectly shown (Possible fix)


    Bug
    Menus that have a lot of items, so much so that the menu is larger than the browser window, should be resized automatically to fit the window (or maxHeight) via the Ext.menu.Menu.doConstrain function. There seams to be a bug in this function, as such menues are always resized to a minimum size, where no items can be seen, only the scroll buttons.

    run this to see the effect.
    Code:
    var items = [];
    for(var i = 0; i < 100; i++) {
      items.push({text: i})
    };
    Ext.create('Ext.menu.Menu', {items: items}).showAt(10,10)
    Fix:
    In the Ext.menu.Menu.doConstrain function... change:
    Code:
    ...
    delete me.height;
    me.setSize();
    full = me.getHeight();
    ...
    to:
    Code:
    ...
    full = me.getHeight();
    delete me.height;
    me.setSize();
    ...
    Note: to any one that wants to use this fix, I suggest using Ext.override(Ext.menu.Menu, { doConstrain: function() {....}}); as opposed to altering ext-all.js/ext-all-debug.js.

  2. #2
    Sencha User
    Join Date
    Oct 2010
    Posts
    20
    Vote Rating
    0
    Evantan is on a distinguished road

      0  

    Default


    And this bug also show in the "Toolbar with Menus" examples. Just click the "Scrolling Menu" button in toolbar.

    BTW: how to specify a menu's height (or items count) and explicitly use the scroll buttons?

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    6
    Vote Rating
    0
    DavidEichmann is on a distinguished road

      0  

    Default


    Look into the maxHeight option for the Ext.menu.Menu object... This should work (but doesn't)... you may need to look into the Ext.menu.Menu.doConstrain function again, to find out whats going wrong.

  4. #4
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    59
    Vote Rating
    3
    wsi is on a distinguished road

      0  

    Default


    Thanks. This override worked.

    The respective scrollers still remain visible and enabled when scrolled to the very top or bottom, but that's a lesser bug/usability issue.

  5. #5
    Ext JS Premium Member burnnat's Avatar
    Join Date
    Jun 2011
    Posts
    418
    Vote Rating
    61
    burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough

      0  

    Default


    Just a note for those following this issue: it looks like this is the same bug as EXTJSIV-3340.

Thread Participants: 3