From 8bea1478100610dae4986667ae60f89d2389d923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Nogueira?= Date: Mon, 5 Mar 2018 13:52:17 +0100 Subject: [PATCH] fix: pressing enter submits the form check: https://github.com/angular/material/commit/eecc5410dbfcdc59e2cba3f4255f03b58783ae27 --- src/core/services/gesture/gesture.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/services/gesture/gesture.js b/src/core/services/gesture/gesture.js index 4ed6893a226..7faec5621cf 100644 --- a/src/core/services/gesture/gesture.js +++ b/src/core/services/gesture/gesture.js @@ -520,8 +520,10 @@ function attachToDocument( $mdGesture, $$MdGestureHandler ) { function clickHijacker(ev) { var isKeyClick = ev.clientX === 0 && ev.clientY === 0; + var isSubmitEvent = ev.target && ev.target.type === 'submit'; if (!isKeyClick && !ev.$material && !ev.isIonicTap - && !isInputEventFromLabelClick(ev)) { + && !isInputEventFromLabelClick(ev) + && !isSubmitEvent) { ev.preventDefault(); ev.stopPropagation(); lastLabelClickPos = null;