From 2845d38d405148b8628929e1cadc0ffe7f6f8abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Sun, 9 Dec 2012 12:58:47 +0100 Subject: [PATCH] Selectmenu: Select value when closing with space --- ui/jquery.ui.selectmenu.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 5d531fc32..f03a66927 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -346,7 +346,11 @@ $.widget( "ui.selectmenu", { } break; case $.ui.keyCode.SPACE: - this._toggle( event ); + if ( this.isOpen ) { + this.menu.menu( "select", event ); + } else { + this._toggle( event ); + } break; case $.ui.keyCode.LEFT: this._move( "previous", event );