Skip to content

Commit

Permalink
Merge pull request #171 from getodk/fix/select-violation-aggregation
Browse files Browse the repository at this point in the history
Fix: reactive aggregation of validation violations from selects
  • Loading branch information
eyelidlessness authored Jul 17, 2024
2 parents a933f6f + e81aa43 commit cfde5ea
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 159 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-sheep-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@getodk/xforms-engine': patch
---

Fix: reactive aggregation of validation violations from selects
7 changes: 1 addition & 6 deletions packages/xforms-engine/src/instance/SelectField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,7 @@ export class SelectField
}

getViolation(): AnyViolation | null {
// Read engine state to ensure reactivity in engine, Solid-based clients
this.validation.engineState.violation;

// Read/return client state to ensure client reactivity, regardless of
// client's reactive implementation
return this.validationState.violation;
return this.validation.engineState.violation;
}

protected getSelectItemsByValue(
Expand Down
Loading

0 comments on commit cfde5ea

Please sign in to comment.