don't close menu on enter, but submit input on enter in autocompletemenu if no menu item was selected
This commit is contained in:
parent
256c0cfa0d
commit
dc0c504809
2 changed files with 8 additions and 6 deletions
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue