Results 1 to 7 of 7

Thread: Menu.getRefItems should check also if Menu is destroyed

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    807

    Default Menu.getRefItems should check also if Menu is destroyed

    If the Menu is closable and the close action is destroy, then when querying or clicking on the button to show the menu again, me.items is null error is thrown:

    There are needed some sanity check on the:

    Code:
    getRefItems: function (deep) {
        var menu = this.menu,
    items = [];
    
    if (menu) {
            if (deep && !menu.isDestroyed && menu.items) {
                items = menu.getRefItems(deep);
    }
            items.unshift(menu);
    }
    
        return items;
    },
    And this one also has to be fixed

    issue.jpg
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    I don't really think this is a bug, there's nothing that notifies the button it should no longer have a menu. A null check, especially in showMenu would be odd, since the button would still be displaying an indicator that it had a menu.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha Premium User vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    807

    Default

    So are are you saying that this is not a bug ?

    https://fiddle.sencha.com/#fiddle/1ii6

    The getRefItems should check if the menu is destroyed or not. We can't check everywhere where this scenario may happen. Imo it's obvious that a global fix is need.
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  4. #4
    Sencha Premium User vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    807

    Default

    Screen Shot 2016-10-14 at 11.03.13 AM.png

    Also probably the theme/CSS for the menu header also should be fixed, as it seems that the menu.closable wasn't thought to be used like this
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  5. #5
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    No, I don't think it's a bug. If you want the menu to be nulled out on the button, then a call to setMenu() should be made.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  6. #6
    Sencha Premium User vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    807

    Default

    Quote Originally Posted by evant View Post
    No, I don't think it's a bug. If you want the menu to be nulled out on the button, then a call to setMenu() should be made.
    I don't want the menu to be nulled out on the button. I want to search for a button in a container, that container may have a menu which was closed, and on close by default the menu is destroyed, and when searching the ComponentQuery is trying to search trough the destroyed menu and throws the null error. Please check the fiddle, I've modified the example which shows that's clearly a bug.
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  7. #7
    Sencha Premium User vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    807

    Default

    And you clearly can't deny the CSS issue with the menu header being un-styled.
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

Similar Threads

  1. [OPEN] Menu not destroyed on item selection
    By nikolay.bobrovskiy in forum Ext 5: Bugs
    Replies: 2
    Last Post: 16 Apr 2015, 12:36 PM
  2. Replies: 1
    Last Post: 2 Oct 2013, 4:03 AM
  3. [CLOSED] Menu on close not destroyed
    By traxanos in forum Ext:Bugs
    Replies: 7
    Last Post: 11 Oct 2011, 5:00 AM
  4. Replies: 14
    Last Post: 9 Dec 2009, 9:40 AM
  5. Mouse click does not work on menu items(when menu is rendered as context menu)
    By anilcs0405 in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 3 Aug 2009, 5:55 AM

Tags for this Thread

Posting Permissions

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