diff options
Diffstat (limited to 'jquery.multiple.select.js')
-rw-r--r-- | jquery.multiple.select.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js index cf858b3..95269c0 100644 --- a/jquery.multiple.select.js +++ b/jquery.multiple.select.js @@ -171,7 +171,16 @@ break; } }); - this.$searchInput.off('keyup').on('keyup', function() { + this.$searchInput.off('keyup').on('keyup', function(e) { + if (that.options.filterAcceptOnEnter && + (e.which === 13 || e.which == 32) && // enter or space + that.$searchInput.val() // Avoid selecting/deselecting if no choices made + ) { + that.$selectAll.click(); + that.close(); + that.focus(); + return; + } that.filter(); }); this.$selectAll.off('click').on('click', function() { |