Skip to content

Commit

Permalink
Fix: reactive aggregation of validation violations from selects
Browse files Browse the repository at this point in the history
Fixes #170.
  • Loading branch information
eyelidlessness committed Jul 16, 2024
1 parent a933f6f commit e81aa43
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 e81aa43

Please sign in to comment.