Skip to content

feat(forms): Allow form fields to be deleted and preserve value #93564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

scttcper
Copy link
Member

Right now if you want to preserve the value when adding and removing fields you would need to store the value outside the form model which defeats the purpose of the form model if you need another source of truth.

Adding preserveOnUnmount will help us use the form model in detectors. In the below video, we'd like to be able to preserve the model's value when switching between detector types.

CleanShot.2025-06-13.at.11.18.13.mp4

Right now if you want to preserve the value when adding and removing fields you would need to store the value outside the form model which defeats the purpose of the form model if you need another source of truth.

Adding `preserveOnUnmount` will help us use the form model in detectors.
@scttcper scttcper requested a review from a team as a code owner June 13, 2025 21:31
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 13, 2025
@scttcper scttcper requested a review from a team June 13, 2025 21:31
@scttcper scttcper merged commit 165517a into master Jun 16, 2025
46 checks passed
@scttcper scttcper deleted the scttcper/preserveOnUnmount branch June 16, 2025 17:46
billyvg pushed a commit that referenced this pull request Jun 18, 2025
Right now if you want to preserve the value when adding and removing
fields you would need to store the value outside the form model which
defeats the purpose of the form model if you need another source of
truth.

Adding `preserveOnUnmount` will help us use the form model in detectors.
In the below video, we'd like to be able to preserve the model's value
when switching between detector types.


https://github.com/user-attachments/assets/dd512ddb-9e55-449f-a5cd-0f244e747034
andrewshie-sentry pushed a commit that referenced this pull request Jun 19, 2025
Right now if you want to preserve the value when adding and removing
fields you would need to store the value outside the form model which
defeats the purpose of the form model if you need another source of
truth.

Adding `preserveOnUnmount` will help us use the form model in detectors.
In the below video, we'd like to be able to preserve the model's value
when switching between detector types.


https://github.com/user-attachments/assets/dd512ddb-9e55-449f-a5cd-0f244e747034
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants