Dropdowns keep the saved value after saving (#114) #127

Merged
miko merged 2 commits from feature/114-dropdown-refresh into development 2026-11-05 20:19:15 +01:00
Owner

Fixes #114: after choosing a value in a dropdown and saving, the old value showed again until a reload.

React 19 resets a form once its Server Action has run, and a <select> resets to the option that was its default when it mounted, ignoring a defaultValue changed since. Text inputs, radios and checkboxes follow the new default; selects don't. It showed in the settings form; the guide properties form remounts per version and the other forms redirect, so they were spared.

  • New src/forms/components/Select.tsx: a native select keyed by its defaultValue, so it mounts afresh when the saved value changes.
  • Every uncontrolled <select defaultValue> in the forms uses it (settings, license, guide properties, ownership, new guide, import, category). Controlled selects (menu editor, locale switch) are unchanged.
  • e2e/settings.spec.ts: saves the top-level child order to manual and back, checking the dropdown after each save without a reload (failed before the fix).
  • CHANGELOG entry under fixed.

Typecheck, lint, 555 unit tests and all 72 e2e tests pass.

🤖 Generated with Claude Code

Fixes #114: after choosing a value in a dropdown and saving, the old value showed again until a reload. React 19 resets a form once its Server Action has run, and a `<select>` resets to the option that was its default when it mounted, ignoring a `defaultValue` changed since. Text inputs, radios and checkboxes follow the new default; selects don't. It showed in the settings form; the guide properties form remounts per version and the other forms redirect, so they were spared. - New `src/forms/components/Select.tsx`: a native select keyed by its `defaultValue`, so it mounts afresh when the saved value changes. - Every uncontrolled `<select defaultValue>` in the forms uses it (settings, license, guide properties, ownership, new guide, import, category). Controlled selects (menu editor, locale switch) are unchanged. - `e2e/settings.spec.ts`: saves the top-level child order to manual and back, checking the dropdown after each save without a reload (failed before the fix). - CHANGELOG entry under fixed. Typecheck, lint, 555 unit tests and all 72 e2e tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
React resets a form after its Server Action, and a select resets to the
option that was its default when it mounted, not to a defaultValue changed
since. A shared Select, keyed by its default, mounts afresh when the saved
value changes; every defaultValue select in the forms uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit 41f824cc97 into development 2026-11-05 20:19:15 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba!127
No description provided.