From 1f80769d9e8e26740fbc6cd7c9afa939dff59d7f Mon Sep 17 00:00:00 2001 From: Jason Hu Date: Mon, 16 Jul 2018 23:38:40 -0700 Subject: [PATCH] Submit form when Enter pressed in new login form (#1459) --- src/auth/ha-auth-flow.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/auth/ha-auth-flow.js b/src/auth/ha-auth-flow.js index e2770eee22..d398161635 100644 --- a/src/auth/ha-auth-flow.js +++ b/src/auth/ha-auth-flow.js @@ -48,6 +48,17 @@ class HaAuthFlow extends EventsMixin(PolymerElement) { _step: Object, }; } + + async ready() { + super.ready(); + + this.addEventListener('keypress', (ev) => { + if (ev.keyCode === 13) { + this._handleSubmit(); + } + }); + } + connectedCallback() { super.connectedCallback();