aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTJ VanToll <tj.vantoll@gmail.com>2014-09-24 10:47:29 -0400
committerTJ VanToll <tj.vantoll@gmail.com>2014-10-25 10:10:38 -0700
commit4ac7b1f679de3df93f6a3681334ef0ecaf12bcb2 (patch)
treeff4b010c14af074ed3beea69d3e2230d1730d8a8
parentde2ef2a585447cf75fc8d4a734c12aa2bbd028c2 (diff)
downloadjquery-ui-4ac7b1f679de3df93f6a3681334ef0ecaf12bcb2.tar.gz
jquery-ui-4ac7b1f679de3df93f6a3681334ef0ecaf12bcb2.zip
Autocomplete: Re-add wrappers to menu items
-rw-r--r--demos/autocomplete/custom-data.html2
-rw-r--r--tests/unit/autocomplete/autocomplete_core.js3
-rw-r--r--tests/unit/autocomplete/autocomplete_options.js2
-rw-r--r--ui/autocomplete.js4
4 files changed, 7 insertions, 4 deletions
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 $( "<li>" )
- .append( "<a>" + item.label + "<br>" + item.desc + "</a>" )
+ .append( "<div>" + item.label + "<br>" + item.desc + "</div>" )
.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 $( "<li>" ).text( item.label ).appendTo( ul );
+ return $( "<li>" )
+ .append( $( "<div>" ).text( item.label ) )
+ .appendTo( ul );
},
_move: function( direction, event ) {