From 018590064f43c4003fe7be767f5c1d666e38b22a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Wed, 4 May 2011 11:20:04 +0200 Subject: [PATCH] Popup: Prevent SPACE key event on trigger from scrolling the page --- tests/visual/menu/popup.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/visual/menu/popup.js b/tests/visual/menu/popup.js index 503bb93b7..a29904877 100644 --- a/tests/visual/menu/popup.js +++ b/tests/visual/menu/popup.js @@ -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) { -- 2.39.5