Skip to content

Fix oneOf renderers not clearing some primitive values#2520

Merged
lucas-koehler merged 3 commits into
masterfrom
lk/issues/2506-vue-vanilla-oneOf-bug
Apr 7, 2026
Merged

Fix oneOf renderers not clearing some primitive values#2520
lucas-koehler merged 3 commits into
masterfrom
lk/issues/2506-vue-vanilla-oneOf-bug

Conversation

@lucas-koehler

Copy link
Copy Markdown
Contributor

Replace isEmpty check with check against undefined because isEmpty always returns true for boolean values, 0, empty strings and objects without props. This lead to errors when switching from any of these to an array and trying to add elements there.

Also adds unit tests for this.

fixes #2506

@netlify

netlify Bot commented Dec 18, 2025

Copy link
Copy Markdown

Deploy Preview for jsonforms-examples ready!

Name Link
🔨 Latest commit df27638
🔍 Latest deploy log https://app.netlify.com/projects/jsonforms-examples/deploys/69afff5ae14f8f000798fe13
😎 Deploy Preview https://deploy-preview-2520--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.

@lucas-koehler
lucas-koehler requested a review from sdirix December 18, 2025 11:58
Comment thread packages/vue-vanilla/src/complex/OneOfRenderer.vue
Comment thread packages/vue-vanilla/tests/unit/util/index.ts Outdated
Replace isEmpty check with check against undefined because isEmpty always returns true
for boolean values, 0, empty strings and objects without props.
This lead to errors when switching from any of these to an array and trying to add
elements there.

Also adds unit tests for this.

fixes #2506
Replace isEmpty check with check against undefined because isEmpty always returns true
for boolean values, 0, empty strings and objects without props.
This could lead to errors when switching from any of these to an array and trying to add
elements there.
Replace isEmpty check with check against undefined because isEmpty always returns true
for boolean values, 0, empty strings and objects without props.
This could lead to errors when switching from any of these to an array and trying to add
elements there.
@lucas-koehler
lucas-koehler force-pushed the lk/issues/2506-vue-vanilla-oneOf-bug branch from 5072070 to df27638 Compare March 10, 2026 11:24
@lucas-koehler

Copy link
Copy Markdown
Contributor Author

@sdirix Thanks for the feedback! Your points make total sense and I implemented them :)

@lucas-koehler
lucas-koehler requested a review from sdirix March 10, 2026 11:24
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 82.851% (-0.001%) from 82.852%
when pulling df27638 on lk/issues/2506-vue-vanilla-oneOf-bug
into fd7979a on master.

@sdirix sdirix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM Thanks

@lucas-koehler lucas-koehler changed the title vue-vanilla: Fix OneOfRenderer.vue not clearing some primitive values Fix oneOf renderers not clearing some primitive values Apr 7, 2026
@lucas-koehler
lucas-koehler merged commit 574e2d1 into master Apr 7, 2026
11 checks passed
@lucas-koehler
lucas-koehler deleted the lk/issues/2506-vue-vanilla-oneOf-bug branch April 7, 2026 08:12
@lucas-koehler lucas-koehler added this to the 3.8 milestone Apr 7, 2026
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.

Vue Vanilla OneOf renderer fails to properly switch between boolean and array values

3 participants