Skip to content

Difference in mapAdditionalProps props.data and global data when setting a prop as undefined via handleChange #1790

@JBBianchi

Description

@JBBianchi

Describe the bug

When implementing DispatchPropsOfControl.handleChange() in a custom control and calling handleChange('somePath', undefined), the property at somePath of the global data object is removed but in mapAdditionalProps(props), the property still exists with an undefined value in props.data.

This is useful when handling additionalProperties for instance.

Expected behavior

For the property to be remove of props.data

Steps to reproduce the issue

https://github.com/JBBianchi/jsonforms-angular-seed/blob/master/src/app/edit-object.renderer.ts#L105

  1. Clone & run the above project
  2. Test and debug the "object editor" sample (not the "dictionary" sample)

Screenshots

No response

In which browser are you experiencing the issue?

any

Framework

Angular

RendererSet

Material

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions