Skip to content

Keep the chosen folder showing in the form's Folder dropdown - #562

Merged
doomlab merged 1 commit into
devfrom
fix/537-folder-dropdown-shows-selection
Oct 9, 2026
Merged

doomlab merged 1 commit into
devfrom
fix/537-folder-dropdown-shows-selection

Conversation

@doomlab

@doomlab doomlab commented Oct 9, 2026

Copy link
Copy Markdown
Member

Closes #537

Problem

On a form's edit page, picking a folder from the Folder dropdown saved it, but the dropdown snapped back to the old folder, so it looked as if nothing had happened (confusing, as the reporter notes, with many folders).

Cause

The dropdown's value came only from the currentFolderId prop, which is the folder the form had when the page loaded. FormPlayground doesn't pass an onUpdate back to it, so after a change the prop never changed and React reset the select to the old value, even though the change had been saved.

Fix

FormFolderSelector keeps its own selected folder: set immediately when you choose (including "No folder" and a newly created folder), still follows the prop if the page does pass a new one, and put back to the previous folder with an error message if the save fails (rather than showing a folder that wasn't saved).

Testing

FormFolderSelector.test.tsx (6 tests): shows the form's folder; keeps the chosen folder when the parent never passes it back; No folder; reverts with a message if saving fails; follows a changed prop; a new folder gets selected. 4 of them fail against the old component. Typecheck (apart from the existing getJsonSchema.test.ts errors), lint and the full suite pass. Not yet checked in a browser.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@doomlab
doomlab merged commit 6657337 into dev Oct 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][UI] Cannot select from the Folder dropdown list

1 participant