Blur active field before submit validation

pull/21833/head
J. Ryan Stinnett 2019-04-25 11:27:03 +01:00
parent 26f732723e
commit af17829229
1 changed files with 7 additions and 0 deletions

View File

@ -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,