Blur active field before submit validation
This commit is contained in:
parent
26f732723e
commit
af17829229
1 changed files with 7 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue