]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Insert the live region before the input. Fixes #9172 - Autocomplete...
authorScott González <scott.gonzalez@gmail.com>
Thu, 21 Mar 2013 19:54:50 +0000 (15:54 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 21 Mar 2013 19:54:50 +0000 (15:54 -0400)
tests/unit/autocomplete/autocomplete_core.js
ui/jquery.ui.autocomplete.js

index a9fc1143c50f20a267a38196d4758e2998c7fc2f..6f11959103616886d7d92c3eca54086c726de297 100644 (file)
@@ -188,4 +188,14 @@ test( "ARIA", function() {
                "Live region for multiple values" );
 });
 
+test( ".replaceWith() (#9172)", function() {
+       expect( 1 );
+
+       var element = $( "#autocomplete" ).autocomplete(),
+               replacement = "<div>test</div>",
+               parent = element.parent();
+       element.replaceWith( replacement );
+       equal( parent.html(), replacement );
+});
+
 }( jQuery ) );
index 3d034337940cf72cd57cbf0278920a60ef7ed77b..28cfdf2fbb8751db305a7e2fa4021407427de9dd 100644 (file)
@@ -296,7 +296,7 @@ $.widget( "ui.autocomplete", {
                                "aria-live": "polite"
                        })
                        .addClass( "ui-helper-hidden-accessible" )
-                       .insertAfter( this.element );
+                       .insertBefore( this.element );
 
                // turning off autocomplete prevents the browser from remembering the
                // value when navigating through history, so we re-enable autocomplete