Skip to content
Permalink
Browse files

Popup: Improve key handling

  • Loading branch information...
jzaefferer committed May 6, 2011
1 parent 2cf85da commit f7e8331e260a03d0ccc286deeeb7bf878f078ff4
Showing with 5 additions and 5 deletions.
  1. +5 −5 tests/visual/menu/popup.js
@@ -38,13 +38,13 @@ $.widget( "ui.popup", {

this._bind(this.options.trigger, {
keydown: function( event ) {
// prevent space-to-open to scroll the page
// TODO do this only for a:ui-button?
if (event.keyCode == $.ui.keyCode.SPACE) {
// prevent space-to-open to scroll the page, only hapens for anchor ui.button
if ($( event.currentTarget ).is( "a:ui-button" ) && event.keyCode == $.ui.keyCode.SPACE) {
event.preventDefault()
}
// TODO handle keydown to open popup?
//if (event.keyCode == $.ui.keyCode.SPACE) { .. }
// TODO handle keydown to open popup? only when not handled by ui.button
//if (event.keyCode == $.ui.keyCode.SPACE) {
//}
},
click: function( event ) {
event.preventDefault();

0 comments on commit f7e8331

Please sign in to comment.
You can’t perform that action at this time.