Skip to content

Conversation

kchobantonov
Copy link
Contributor

@kchobantonov kchobantonov commented Aug 21, 2025

fix how we handle empty values when not in dynamic context (e.g. addtionalProperties case)

Copy link

netlify bot commented Aug 21, 2025

Deploy Preview for jsonforms-examples ready!

Name Link
🔨 Latest commit cc45d6a
🔍 Latest deploy log https://app.netlify.com/projects/jsonforms-examples/deploys/68a8aa9446f2410008dee4b2
😎 Deploy Preview https://deploy-preview-2481--jsonforms-examples.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kchobantonov kchobantonov changed the title fix how we handle empty values when not in dynamic context (e.g. addi… fix how we handle empty values Aug 21, 2025
@kchobantonov
Copy link
Contributor Author

@sdirix please review - when we update the handling of empty values it looks like deleting (not using the x - clear ) was setting the value to empty string rather to remove the property when we are not under dynamic context (e.g. additionalProperties where we need to preserve the key)

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

Changes make sense to me in general. However there are a number of "non-changes" in the PR. Also I just noticed that we might have an overall enum issue.

const clearValue = determineClearValue('');
return useVuetifyControl(useJsonFormsEnumControl(props), (value) =>
value === null ? clearValue : value,
value !== null ? value : clearValue,
Copy link
Member

Choose a reason for hiding this comment

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

This is not an actual change.

return useVuetifyControl(
useJsonFormsEnumControl(props),
(value) => (value === null ? clearValue : value),
(value) => (value !== null ? value : clearValue),
Copy link
Member

Choose a reason for hiding this comment

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

Thinking about it, this behavior is a bit dangerous for all enum related controls. null could be a valid enum value. Why are we not using undefined as the marker for the clearValue again?

return useVuetifyControl(
useJsonFormsOneOfEnumControl(props),
(value) => (value === null ? clearValue : value),
(value) => (value !== null ? value : clearValue),
Copy link
Member

Choose a reason for hiding this comment

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

Not a change

return useVuetifyControl(
useJsonFormsEnumControl(props),
(value) => (value === null ? clearValue : value),
(value) => (value !== null ? value : clearValue),
Copy link
Member

Choose a reason for hiding this comment

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

Not a change

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