aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2011-12-22 02:22:10 +0100
committerFelix Nagel <info@felixnagel.com>2011-12-22 02:22:10 +0100
commit8e4dc4017b684b0943d2aa965bc471c23eff36e8 (patch)
tree515f160b0166c9cdece2791c63eb506636ea947f /ui
parenta5560f3037d04a8cac875b4df8e6309c0fbf355c (diff)
downloadjquery-ui-8e4dc4017b684b0943d2aa965bc471c23eff36e8.tar.gz
jquery-ui-8e4dc4017b684b0943d2aa965bc471c23eff36e8.zip
Selectmenu: improved handing of (ARIA) attributes
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.selectmenu.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index e8d97d2cd..6dacff749 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -102,10 +102,8 @@ $.widget( "ui.selectmenu", {
// create menu portion, append to body
this.menu = $( '<ul />', {
- 'class': 'ui-widget ui-widget-content',
'aria-hidden': true,
'aria-labelledby': this.ids.button,
- role: 'menubox',
id: this.ids.menu
});
@@ -152,7 +150,9 @@ $.widget( "ui.selectmenu", {
that.focus = item.index;
}
- });
+ })
+ // change ARIA role
+ .attr( 'role', 'menubox' );
// document click closes menu
this._bind( document, {
@@ -171,6 +171,7 @@ $.widget( "ui.selectmenu", {
this._renderMenu( this.menu, this.items );
this.menu.menu( "refresh" );
+ this.menu.menu( "focus", null, this._getSelectedItem() );
// adjust ARIA
this.menu.find( "li" ).not( '.ui-selectmenu-optgroup' ).find( 'a' ).attr( 'role', 'option' );