From: TJ VanToll Date: Wed, 24 Sep 2014 14:47:29 +0000 (-0400) Subject: Autocomplete: Re-add wrappers to menu items X-Git-Tag: 1.12.0-beta.1~488 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4ac7b1f679de3df93f6a3681334ef0ecaf12bcb2;p=jquery-ui.git Autocomplete: Re-add wrappers to menu items --- diff --git a/demos/autocomplete/custom-data.html b/demos/autocomplete/custom-data.html index c243775a3..1c94a877a 100644 --- a/demos/autocomplete/custom-data.html +++ b/demos/autocomplete/custom-data.html @@ -68,7 +68,7 @@ }) .autocomplete( "instance" )._renderItem = function( ul, item ) { return $( "
  • " ) - .append( "" + item.label + "
    " + item.desc + "
    " ) + .append( "
    " + item.label + "
    " + item.desc + "
    " ) .appendTo( ul ); }; }); diff --git a/tests/unit/autocomplete/autocomplete_core.js b/tests/unit/autocomplete/autocomplete_core.js index 2dda45b4d..fa3f9abb0 100644 --- a/tests/unit/autocomplete/autocomplete_core.js +++ b/tests/unit/autocomplete/autocomplete_core.js @@ -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; diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js index 2a65b1100..226db29ed 100644 --- a/tests/unit/autocomplete/autocomplete_options.js +++ b/tests/unit/autocomplete/autocomplete_options.js @@ -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" ); diff --git a/ui/autocomplete.js b/ui/autocomplete.js index 0132ed7f3..aa0e54633 100644 --- a/ui/autocomplete.js +++ b/ui/autocomplete.js @@ -542,7 +542,9 @@ $.widget( "ui.autocomplete", { }, _renderItem: function( ul, item ) { - return $( "
  • " ).text( item.label ).appendTo( ul ); + return $( "
  • " ) + .append( $( "
    " ).text( item.label ) ) + .appendTo( ul ); }, _move: function( direction, event ) {