mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Autocomplete: Append liveRegion to body to support detached init. Fixes #9590 - Dynamically adding input field breaks auto-complete's accessibility for screen readers
This commit is contained in:
parent
b99f8258bf
commit
7b9c810b9a
@ -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 );
|
||||
|
||||
|
2
ui/jquery.ui.autocomplete.js
vendored
2
ui/jquery.ui.autocomplete.js
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user