Skip to content
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

feat: add destroyOnUnregister property #206

Merged
merged 2 commits into from
Jul 1, 2024
Merged

Conversation

vvasin
Copy link
Contributor

@vvasin vvasin commented Jun 28, 2024

By default, dynamic forms clear the final form field value on unmount. This should be configurable. The name of the property and its description comes from the final form docs

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Playwright Test Component is ready.

form.change(store.name, undefined);
}
};
}, []);
}, [destroyOnUnregister]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here this flag should not cause an effect, its value will be relevant in the callback, this is the main thing that we need

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its value will be relevant in the callback

I don't think so, on "unmount" it will have the first value provided in this case, and it will be not updated on prop change.

But generally, yes, the "logic part" shouldn't be triggered by its value change. And most likely it won't be changed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, on "unmount" it will have the first value provided in this case, and it will be not updated on prop change.

Oh, you're right, we'll have to go back to this place and make the flag and store.name the callback was relevant

@vvasin vvasin merged commit d2b7ce6 into main Jul 1, 2024
4 checks passed
@vvasin vvasin deleted the destroy-on-unregister-option branch July 1, 2024 09:16
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.

3 participants