From af178292290337c8b7cdedac3a24d02b1670a646 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 25 Apr 2019 11:27:03 +0100 Subject: [PATCH] Blur active field before submit validation --- src/components/views/auth/RegistrationForm.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/views/auth/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js index 0045b4dd59..6e55581af0 100644 --- a/src/components/views/auth/RegistrationForm.js +++ b/src/components/views/auth/RegistrationForm.js @@ -128,6 +128,13 @@ module.exports = React.createClass({ }, async verifyFieldsBeforeSubmit() { + // Blur the active element if any, so we first run its blur validation, + // which is less strict than the pass we're about to do below for all fields. + const activeElement = document.activeElement; + if (activeElement) { + activeElement.blur(); + } + const fieldIDsInDisplayOrder = [ FIELD_USERNAME, FIELD_PASSWORD,