]> 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>
Wed, 17 Apr 2013 15:55:51 +0000 (11:55 -0400)
(cherry picked from commit ff11b69a67e0176c851ff3bdec997c7a75d47a42)

tests/unit/autocomplete/autocomplete_core.js
ui/jquery.ui.autocomplete.js

index 845a3b19de6c1b9af0a6c76fb74dc8f1e0120275..8a01bee8d1665c123bfaf775171e3afc2070b183 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 8309726034eda8aefea9ddcb8eba8729c5c07871..d98eb8c00bf4e4d54297dfa298f032fd3e8f601b 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