Skip to content
Permalink
Browse files

fix(cf-navigation): add compute watcher on hidden state (#225)

Without this, the hidden state of fields considered in the "state"
computation of navigation entries "lags" behind it's actual value.
  • Loading branch information...
czosel committed May 13, 2019
1 parent 1d7a944 commit 41ba470dfa7fc44851ce2d7cbd069e748b5db5f9
Showing with 2 additions and 2 deletions.
  1. +2 −2 addon/lib/document.js
@@ -178,13 +178,13 @@ export default EmberObject.extend({
),

ownState: computed(
"fields.@each.{isNew,isValid,_errors,question,childDocument}",
"fields.@each.{isNew,isValid,_errors,hidden,question,childDocument}",
function() {
if (this.fields.every(f => f.isNew)) {
return "untouched";
}

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

if (

0 comments on commit 41ba470

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