Skip to content
Permalink
Browse files

fix: consider empty but required fields (#220)

* fix: consider empty but required fields

* fix: use optional bool instead of isRequired string
  • Loading branch information...
fkm authored and czosel committed May 9, 2019
1 parent 28a841b commit 3538471dce9c46c78abbb5af830cd433ae728c32
Showing with 6 additions and 1 deletion.
  1. +6 −1 addon/lib/document.js
@@ -185,7 +185,12 @@ export default EmberObject.extend({
}

const visibleFields = this.fields.filter(f => !f.question.hidden);
if (visibleFields.every(f => f.isValid)) {
const requiredFields = visibleFields.filter(f => !f.question.optional);

if (
visibleFields.every(f => f.isValid) &&
requiredFields.every(f => !f.isNew)
) {
return "valid";
}

0 comments on commit 3538471

Please sign in to comment.
You can’t perform that action at this time.