Permalink
Browse files

Selectmenu: changed from return false to event.preventDefault()

  • Loading branch information...
1 parent fd69abb commit 3e1557b654e88852ef405422d13eb035dc33e929 @fnagel fnagel committed Sep 28, 2011
Showing with 6 additions and 8 deletions.
  1. +6 −8 ui/jquery.ui.selectmenu.js
View
@@ -100,47 +100,45 @@ $.widget( "ui.selectmenu", {
return false;
},
'keydown.selectmenu': function( event ) {
- var ret = true;
switch (event.keyCode) {
case $.ui.keyCode.TAB:
if ( self.opened ) self.close();
break;
case $.ui.keyCode.ENTER:
if ( self.opened ) self.list.menu( "select", self._getSelectedItem() );
- ret = false;
+ event.preventDefault();
break;
case $.ui.keyCode.SPACE:
self._toggle(event);
- ret = false;
+ event.preventDefault();
break;
case $.ui.keyCode.UP:
if ( event.altKey ) {
self._toggle( event );
} else {
self._move( "previous", event );
}
- ret = false;
+ event.preventDefault();
break;
case $.ui.keyCode.DOWN:
if ( event.altKey ) {
self._toggle( event );
} else {
self._move( "next", event );
}
- ret = false;
+ event.preventDefault();
break;
case $.ui.keyCode.LEFT:
self._move( "previous", event );
- ret = false;
+ event.preventDefault();
break;
case $.ui.keyCode.RIGHT:
self._move( "next", event );
- ret = false;
+ event.preventDefault();
break;
default:
self.list.trigger( event );
}
- return ret;
}
});

0 comments on commit 3e1557b

Please sign in to comment.