Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
"flux-store-solid2-migration",
"focus-restore-primitive",
"focus-solid2-migration",
"form-change-mode-dirty-gate-fix",
"form-solid2-initial",
"fullscreen-solid-2-migration",
"geolocation-solid2-async-reactivity",
Expand Down
12 changes: 12 additions & 0 deletions packages/form/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @solid-primitives/form

## 1.0.0-next.3

### Patch Changes

- 1c687d9: Fix `createForm`'s default `validateOn: "change"` mode showing a field's error immediately on mount, before the user had touched it. `error()` was wired directly to the raw, ungated validation result for `"change"` mode, so any field whose initial value failed validation (e.g. a required field starting empty) rendered errored from the first paint.

`"change"` mode's validator error is now gated on per-field dirtiness (`value() !== initial`) — hidden until the field's value actually changes, and hidden again if it's changed back to the initial value. `blur`/`submit` modes are unaffected (still gated on `touched()`/`submitted()` respectively).

Fixing this also surfaced a second, separate bug: the gating was applied to the _combined_ raw error, which included any `setError()`-injected external error (e.g. a server-side validation message) — so an external error set on a pristine `"change"`-mode field was incorrectly hidden too. External errors are now always shown immediately regardless of mode/dirty/touched/submitted state, matching their documented purpose (`setError`: "Inject an external error (e.g. from a server response)").

`form.errors()` and `form.valid()` are unaffected either way — both were already, and remain, ungated (true validity regardless of display timing).

## 1.0.0-next.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/form/deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solid-primitives/form",
"version": "1.0.0-next.2",
"version": "1.0.0-next.3",
"description": "Reactive form primitive for Solid.js with per-field signals, sync/async validation, validateOn control, and DOM binding.",
"license": "MIT",
"exports": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solid-primitives/form",
"version": "1.0.0-next.2",
"version": "1.0.0-next.3",
"description": "Reactive form primitive with per-field signals, sync/async validation, validateOn control, and DOM binding.",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"contributors": [],
Expand Down