Skip to content

Tooltip: remove name from live Region #1544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/unit/tooltip/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,25 @@ 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' checked='checked'><label>option 1</label>" +
"<input type='radio' name='hobby'><label>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" );
});

} );
1 change: 1 addition & 0 deletions ui/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down