From 911a0bb0826860d4f390c8e48e166db06f1f82fa Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Thu, 14 Mar 2013 11:14:37 -0700 Subject: [PATCH] prevent form from being submitted when enter is pressed in multiselect. fixes #961 --- select2.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/select2.js b/select2.js index 0cbc5abf..f1a46a96 100644 --- a/select2.js +++ b/select2.js @@ -2155,6 +2155,12 @@ the specific language governing permissions and limitations under the Apache Lic // prevent the page from scrolling killEvent(e); } + + if (e.which === KEY.ENTER) { + // prevent form from being submitted + killEvent(e); + } + })); this.search.bind("keyup", this.bind(this.resizeSearch));