Skip to content

Commit

Permalink
fix(calc-questions): always calculate calculated answer if possible
Browse files Browse the repository at this point in the history
We don't need to ensure that *every* dependency is non-hidden; indeed it
should be possible to evaluate an expression where parts of the dependencies
are not set. This is how the backend does it. Also, the `answer` transform
does have a default option, so we should easily be able to deal with this.
  • Loading branch information
winged committed Jan 14, 2025
1 parent 5508ba4 commit b8b06a4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/form/addon/lib/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,7 @@ export default class Field extends Base {
*/
@cached
get calculatedValue() {
if (
!this.question.isCalculated ||
!this.calculatedDependencies.every((field) => !field.hidden)
) {
if (!this.question.isCalculated) {
return null;
}

Expand Down

0 comments on commit b8b06a4

Please sign in to comment.