]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Re-add wrappers to menu items
authorTJ VanToll <tj.vantoll@gmail.com>
Wed, 24 Sep 2014 14:47:29 +0000 (10:47 -0400)
committerTJ VanToll <tj.vantoll@gmail.com>
Sat, 25 Oct 2014 17:10:38 +0000 (10:10 -0700)
demos/autocomplete/custom-data.html
tests/unit/autocomplete/autocomplete_core.js
tests/unit/autocomplete/autocomplete_options.js
ui/autocomplete.js

index c243775a3fa26216598a46dbecabdc08735e30fa..1c94a877a220b88a5d37bf6d2dda6ba0c8de5126 100644 (file)
@@ -68,7 +68,7 @@
                })
                .autocomplete( "instance" )._renderItem = function( ul, item ) {
                        return $( "<li>" )
-                               .append( "<a>" + item.label + "<br>" + item.desc + "</a>" )
+                               .append( "<div>" + item.label + "<br>" + item.desc + "</div>" )
                                .appendTo( ul );
                };
        });
index 2dda45b4d60340314964b108d403ac229a45379a..fa3f9abb072c30a15bb687bbf83efd4ffa6a32d1 100644 (file)
@@ -16,7 +16,8 @@ test( "prevent form submit on enter when menu is active", function() {
        event = $.Event( "keydown" );
        event.keyCode = $.ui.keyCode.DOWN;
        element.trigger( event );
-       equal( menu.find( ".ui-menu-item.ui-state-focus" ).length, 1, "menu item is active" );
+       equal( menu.find( ".ui-menu-item-wrapper.ui-state-focus" ).length, 1,
+               "menu item is active" );
 
        event = $.Event( "keydown" );
        event.keyCode = $.ui.keyCode.ENTER;
index 2a65b11000860d04600381df0ae1fced4ee56107..226db29edce3b6cf177249b6c733e9057e85556e 100644 (file)
@@ -77,7 +77,7 @@ function autoFocusTest( afValue, focusedLength ) {
                open: function() {
                        equal(
                                element.autocomplete( "widget" )
-                                       .children( ".ui-menu-item.ui-state-focus" )
+                                       .find( ".ui-menu-item-wrapper.ui-state-focus" )
                                        .length,
                                focusedLength,
                                "first item is " + (afValue ? "" : "not") + " auto focused" );
index 0132ed7f3a2eb7f12467b04481a7da979f766c95..aa0e546334ebcdbc1333aa68d9ac89b772f2bd4f 100644 (file)
@@ -542,7 +542,9 @@ $.widget( "ui.autocomplete", {
        },
 
        _renderItem: function( ul, item ) {
-               return $( "<li>" ).text( item.label ).appendTo( ul );
+               return $( "<li>" )
+                       .append( $( "<div>" ).text( item.label ) )
+                       .appendTo( ul );
        },
 
        _move: function( direction, event ) {