Opened 9 years ago

Closed 9 years ago

#10575 closed bug (notabug)

Menu: Removal of anchors has side effects

Reported by: lankymart Owned by:
Priority: minor Milestone: none
Component: Version: 1.11.1
Keywords: Cc:
Blocked by: Blocking:


Not sure if this is intended but there are various examples of implementing a header (non selectable list element) but I've found that whatever I try and can't stop the default "ui-menu-item" class being applied to my listitem. I've managed to workout that the examples that work are using 1.8 but I'm using 11.0 and it's defaulting to the "ui-menu-item" and doesn't seem to be over-ridable.

Example of working header

Code Excerpt

      $("#list").autocomplete("instance")._renderMenu = function(ul, items) {
        var self = this;
        $.each( items, function( index, item ) {
          self._renderItemData(ul, item);
          // prepended element still ends up with "ui-menu-item" class??
          if (index == 0) ul.prepend('<li class="ui-header"><span>Returned ' + items.length + ' record(s)</span></li>');
        // attempt to hack css!

I've now pin pointed what I think is the cause it appears after 1.10.4 and is present in 1.11.0 it's in the refresh() method in menu.js (previously

It looks like it's due to the requirement for an anchor to be present being removed (see and

Change History (1)

comment:1 Changed 9 years ago by Scott González

Resolution: notabug
Status: newclosed

The detection wouldn't work as expected anyway, since menu items are now explicitly defined via the items option. See for an example of how you should be doing this.

Note: See TracTickets for help on using tickets.