mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
Tooltip: Remove name attribute from elements in the live region
Fixes #11272 Closes gh-1544
This commit is contained in:
parent
adcc8eff43
commit
2cef124bf2
@ -221,4 +221,29 @@ asyncTest( "multiple active delegated tooltips", function() {
|
||||
step1();
|
||||
});
|
||||
|
||||
// http://bugs.jqueryui.com/ticket/11272
|
||||
test( "remove conflicting attributes from live region", function() {
|
||||
expect( 2 );
|
||||
|
||||
var element = $(
|
||||
"<div id='content'>" +
|
||||
"<input type='radio' name='hobby' id='hobby1' checked='checked'>" +
|
||||
"<label for='hobby1'>option 1</label>" +
|
||||
"<input type='radio' name='hobby' id='hobby2'>" +
|
||||
"<label for='hobby2'>option 2</label>" +
|
||||
"</div>" );
|
||||
|
||||
$( "#tooltipped1" )
|
||||
.tooltip({
|
||||
content: element,
|
||||
open: function() {
|
||||
equal( $( ".ui-helper-hidden-accessible [name]" ).length, 0,
|
||||
"no name attributes within live region" );
|
||||
equal( $( ".ui-helper-hidden-accessible [id]" ).length, 0,
|
||||
"no id attributes within live region" );
|
||||
}
|
||||
})
|
||||
.tooltip( "open" );
|
||||
});
|
||||
|
||||
} );
|
||||
|
@ -287,6 +287,7 @@ $.widget( "ui.tooltip", {
|
||||
// Voiceover will sometimes re-read the entire log region's contents from the beginning
|
||||
this.liveRegion.children().hide();
|
||||
a11yContent = $( "<div>" ).html( tooltip.find( ".ui-tooltip-content" ).html() );
|
||||
a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" );
|
||||
a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
|
||||
a11yContent.appendTo( this.liveRegion );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user