Results 1 to 2 of 2

Thread: autoEl: 'a' with nested items generates an element cache error.

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2008
    Posts
    52

    Default autoEl: 'a' with nested items generates an element cache error.

    I have a pretty standard nav bar that includes a menu for a user's account. I wrap the menu header and menu in an anchor tag to allow the menu to appear when hovering on the menu header and menu.

    Using autoEl to generate the anchor tag results in the following error:

    Code:
    Uncaught Error: DOM element with id account-page-link in Element cache is not the same as element in the DOM. Make sure to clean up Element instances using destroy()
    The extjs code is as follows:

    Code:
    {
      xtype: 'container',
      layout: 'container',
      id: 'nav',
      cls: 'nav',
      items: [
              {
                xtype: 'container',
                layout: 'container',
                autoEl: 'ul',
                items: [
                        {
                          xtype: 'container',
                          layout: 'container',
                          autoEl: 'li',
                          items: [
                                  {
                                    xtype: 'container',
                                    layout: 'container',
                                    autoEl: 'a',
                                    id: 'account-page-link',
                                    items: [
                                            {
                                              xtype: 'container',
                                              layout: 'container',
                                              autoEl: 'span',
                                              cls: 'link-icon',
                                              items: [
                                                      {
                                                        xtype: 'component',
                                                        autoEl: {
                                                          tag: 'img',
                                                          cls: 'avatar',
                                                          src:''
                                                        }
                                                      }        
                                              ]
                                            },
                                            {
                                              xtype: 'accountmenu',
                                              id: 'account-menu-container'
                                            }
                                            ...
    if I remove the autoEl: 'a' attribute or change it to a different tag, such as, autoEl: 'li' the problem goes away. Also, this is not a problem for any of the other autoEl attributes within my nav, the error only occurs when creating the anchor tag.

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

    Default

    I'm not able to reproduce this. Can you post a runnable test case?

    See: https://fiddle.sencha.com/#fiddle/7rm
    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.

Posting Permissions

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