mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dialog: Improve accessibilty - add an aria-describedby attribute on the dialog if there is nothing yet in the dialog content. Partial fix for:
This commit is contained in:
parent
62ae078f14
commit
2a887e4321
10
ui/jquery.ui.dialog.js
vendored
10
ui/jquery.ui.dialog.js
vendored
@ -156,6 +156,15 @@ $.widget("ui.dialog", {
|
||||
"aria-labelledby": uiDialogTitle.attr( "id" )
|
||||
});
|
||||
|
||||
// We assume that any existing aria-describedby attribute means
|
||||
// that the dialog content is marked up properly
|
||||
// otherwise we brute force the content as the description
|
||||
if ( !this.element.find( "[aria-describedby]" ).length ) {
|
||||
uiDialog.attr({
|
||||
"aria-describedby": this.element.uniqueId().attr( "id" )
|
||||
});
|
||||
}
|
||||
|
||||
uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection();
|
||||
this._hoverable( uiDialogTitlebarClose );
|
||||
this._focusable( uiDialogTitlebarClose );
|
||||
@ -205,6 +214,7 @@ $.widget("ui.dialog", {
|
||||
}
|
||||
this.uiDialog.hide();
|
||||
this.element
|
||||
.removeUniqueId()
|
||||
.removeClass( "ui-dialog-content ui-widget-content" )
|
||||
.hide()
|
||||
.appendTo( "body" );
|
||||
|
Loading…
Reference in New Issue
Block a user