Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 21652dd

Browse files
authored
Merge pull request #961 from jesus-clover/ie-object-keys-bug
Preventing Object.keys from being called on a boolean
2 parents 6af57fb + 8a2d27b commit 21652dd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/reducers/form-actions-reducer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,11 @@ export function createFormActionsReducer(options) {
368368
// If the form is invalid (due to async validity)
369369
// but its fields are valid and the value has changed,
370370
// the form should be "valid" again.
371-
if ((!parentForm.$form.validity
372-
|| !parentForm.$form.validity
373-
|| !Object.keys(parentForm.$form.validity).length)
371+
const validityIsBool = typeof parentForm.$form.validity === 'boolean';
372+
const isInvalid = validityIsBool
373+
? !parentForm.$form.validity
374+
: !Object.keys(parentForm.$form.validity).length;
375+
if (isInvalid
374376
&& !parentForm.$form.valid
375377
&& isValid(parentForm, { async: false })) {
376378
return {

0 commit comments

Comments
 (0)