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

Fix(CanvasForm): Set empty object value when selecting the expression #2018

Open
wants to merge 1 commit into
base: feat/form-with-anyof-support
Choose a base branch
from

Conversation

shivamG640
Copy link
Contributor

No description provided.

@shivamG640 shivamG640 force-pushed the Form_V2_Fix branch 2 times, most recently from daecedf to 3aefb83 Compare February 20, 2025 15:03
@shivamG640 shivamG640 marked this pull request as ready for review February 20, 2025 15:03
const newValue = { ...value };
Object.keys(selectedOneOfSchema.schema.properties).forEach((prop) => {
delete (newValue as Record<string, unknown>)[prop];
const newValue = { ...value };
Copy link
Member

Choose a reason for hiding this comment

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

If the value is anything else than an array or object, it will break

Comment on lines 38 to 40
Object.keys(newProps).forEach((prop) => {
setValue(newValue, prop, {});
});
Copy link
Member

Choose a reason for hiding this comment

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

We're assuming we're gonna always render objects, but there's also the chance the prop is a string

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.

2 participants