Skip to content

Commit

Permalink
fix(cf-navigation): add compute watcher on hidden state (#225)
Browse files Browse the repository at this point in the history
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 41ba470
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addon/lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 41ba470

Please sign in to comment.