Popup: Prevent SPACE key event on trigger from scrolling the page

This commit is contained in:
Jörn Zaefferer 2011-05-04 11:20:04 +02:00
parent b96126b398
commit 018590064f

View File

@ -37,6 +37,12 @@ $.widget( "ui.popup", {
this.close();
this._bind(this.options.trigger, {
keydown: function( event ) {
// prevent space-to-open to scroll the page
if (event.keyCode == $.ui.keyCode.SPACE) {
event.preventDefault()
}
},
click: function( event ) {
event.preventDefault();
if (this.open) {