Skip to content

Conversation

@henryqdineen
Copy link
Collaborator

What changed / motivation ?

I noticed a couple small bugs in the Create/Rename file dialog:

  1. If you create a component file and then another it uses the same name
  2. If you open a dialog, modify value, cancel, re-open it would have the modified value

My fix in this PR is to imperatively reset the input value when the dialog closes. I don't love this solution because it is relying on the fact that defaultValue is updated before onClose when the form is submitted but it seems to work and fits in with the uncontrolled input usage. My initial thought was to use a key prop on <FileNameDialog> element to force a remount when the defaultValue changes.

Pre-flight checklist

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant