Skip to content

Commit a361d6e

Browse files
author
Jiabao
committed
Tooltip: remove name from live Region
Fixes: #11272
1 parent 76c2755 commit a361d6e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/unit/tooltip/tooltip_core.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,21 @@ asyncTest( "multiple active delegated tooltips", function() {
220220
});
221221

222222
}( jQuery ) );
223+
224+
// http://bugs.jqueryui.com/ticket/11272
225+
test ( "remove radio button name conflict between live Region and tooltip content", function () {
226+
expect( 1 );
227+
228+
var element = $( "<div id='content'>" +
229+
"<input type='radio' name='hobby' checked='checked'><label>option 1</label>" +
230+
"<input type='radio' name='hobby'><label>option 2</label>" +
231+
"</div>" );
232+
$( "#tooltipped1" )
233+
.tooltip({
234+
content: element,
235+
open: function( event, ui ) {
236+
equal( $( ".ui-helper-hidden-accessible [name]" ).length, 0, 'no name attr within liveRegion');
237+
}
238+
})
239+
.tooltip( "open" );
240+
});

ui/tooltip.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ $.widget( "ui.tooltip", {
287287
// Voiceover will sometimes re-read the entire log region's contents from the beginning
288288
this.liveRegion.children().hide();
289289
a11yContent = $( "<div>" ).html( tooltip.find( ".ui-tooltip-content" ).html() );
290+
a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" );
290291
a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
291292
a11yContent.appendTo( this.liveRegion );
292293

0 commit comments

Comments
 (0)