Skip to content

User-submitted data loss with an additionalProperties object when a title is present  #1382

@erunion

Description

@erunion

Prerequisites

Description

If there is an additionalProperties object present that has a title contained within it, the input for that title is overridden whenever you click out of the input.

Steps to Reproduce

{ "title": "A customizable registration form", "description": "A simple form with additional properties example.", "type": "object", "additionalProperties": { "type": "object", "properties": { "code": { "type": "integer" }, "text": { "type": "string" } }, "title": "This is a custom title" } } 
  1. Click to add a new object
  2. In the "This is a custom title" input box, type "TKTK".
  3. Click out of the input
  4. Input reverts to "This is a custom title" and neither the key, nor the headers the get updated to "TKTK Key" nor "TKTK".
  5. Remove "title": "This is a custom title" from the JSON Schema, repeat steps, everything works as expected.

See this playground link for a quick example: https://mozilla-services.github.io/react-jsonschema-form/#eyJmb3JtRGF0YSI6e30sInNjaGVtYSI6eyJ0aXRsZSI6IkEgY3VzdG9taXphYmxlIHJlZ2lzdHJhdGlvbiBmb3JtIiwiZGVzY3JpcHRpb24iOiJBIHNpbXBsZSBmb3JtIHdpdGggYWRkaXRpb25hbCBwcm9wZXJ0aWVzIGV4YW1wbGUuIiwidHlwZSI6Im9iamVjdCIsImFkZGl0aW9uYWxQcm9wZXJ0aWVzIjp7InR5cGUiOiJvYmplY3QiLCJwcm9wZXJ0aWVzIjp7ImNvZGUiOnsidHlwZSI6ImludGVnZXIifSwidGV4dCI6eyJ0eXBlIjoic3RyaW5nIn19LCJ0aXRsZSI6IlRoaXMgaXMgYSBjdXN0b20gdGl0bGUifX0sInVpU2NoZW1hIjp7fX0=

Expected behavior

The data that is input into the key input should be retained.

Actual behavior

Input data is lost.

Version

dev-master

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions