diff options
-rw-r--r-- | tests/unit/autocomplete/autocomplete_core.js | 9 | ||||
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/tests/unit/autocomplete/autocomplete_core.js b/tests/unit/autocomplete/autocomplete_core.js index a8b0a7330..58e96755a 100644 --- a/tests/unit/autocomplete/autocomplete_core.js +++ b/tests/unit/autocomplete/autocomplete_core.js @@ -257,6 +257,15 @@ test( "ARIA", function() { "Live region for multiple values" ); }); +test( "ARIA, init on detached input", function() { + expect( 1 ); + var element = $( "<input>" ).autocomplete({ + source: [ "java", "javascript" ] + }), + liveRegion = element.autocomplete( "instance" ).liveRegion; + equal( liveRegion.parent().length, 1, "liveRegion must have a parent" ); +}); + test( ".replaceWith() (#9172)", function() { expect( 1 ); diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index d1a3c252d..2b803b62f 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -294,7 +294,7 @@ $.widget( "ui.autocomplete", { "aria-live": "polite" }) .addClass( "ui-helper-hidden-accessible" ) - .insertBefore( this.element ); + .appendTo( this.document[ 0 ].body ); // turning off autocomplete prevents the browser from remembering the // value when navigating through history, so we re-enable autocomplete |