diff --git a/source/Ox.UI/js/Form/Input.js b/source/Ox.UI/js/Form/Input.js index c44bcc95..664c6438 100644 --- a/source/Ox.UI/js/Form/Input.js +++ b/source/Ox.UI/js/Form/Input.js @@ -482,7 +482,7 @@ Ox.Input = function(options, self) { } function constructAutocompleteMenu() { - var menu = Ox.Menu({ + return Ox.Menu({ element: self.$input, id: self.options.id + 'Menu', // fixme: we do this in other places ... are we doing it the same way? var name?, maxWidth: self.options.autocompleteSelectMaxWidth, @@ -490,13 +490,17 @@ Ox.Input = function(options, self) { left: 4, top: 0 } - //size: self.options.size }) .addClass('OxAutocompleteMenu') .bindEvent({ - click: clickMenu + click: clickMenu, + key_enter: function() { + if (self.$autocompleteMenu.is(':visible')) { + self.$autocompleteMenu.hideMenu(); + submit(); + } + } }); - return menu; } function autovalidate() { diff --git a/source/Ox.UI/js/Menu/Menu.js b/source/Ox.UI/js/Menu/Menu.js index fb596dab..1508a2af 100644 --- a/source/Ox.UI/js/Menu/Menu.js +++ b/source/Ox.UI/js/Menu/Menu.js @@ -192,8 +192,6 @@ Ox.Menu = function(options, self) { // called on key.enter if (self.options.selected > -1) { clickItem(self.options.selected); - } else { - that.hideMenu(); } }