Skip to content

Cannot enter values in field with brackets in property name #2102

Open
@PimRheiter

Description

@PimRheiter

Describe the bug

When you add a property with brackets in the property name ("test[0]") in your schema and UI schema, you can't type or enter any value in the corresponding input field.

However, when you pass some value for this field as data, you can type a value in the input field if it's a simple field (not an object with it's own properties).

Expected behavior

I can enter a value in an input field for a property that has brackets in its name.

Steps to reproduce the issue

  1. Clone the jsonforms angular seed from https://github.com/eclipsesource/jsonforms-angular-seed
  2. Replace contents of "src\assets\schema.json" with
{
  "type": "object",
  "properties": {
    "test[0]": { "type": "string" },
    "object[0]": {
      "type": "object",
      "properties": {
        "test": { "type": "string" }
      }
    }
  }
}
  1. Replace contents of "src\assets\uischema.json" with
{
  "type": "VerticalLayout",
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/test[0]"
    },
    {
      "type": "Control",
      "scope": "#/properties/object[0]"
    }
  ]
}
  1. Run the jsonforms angular seed
  2. Go to localhost:4200
  3. Try to type something in the field "Test 0", this does not work
  4. Try to type something in the field "Object 0 Test", this does not work
  5. Replace the contents of "src\app\data.ts" with
export default {
  "test[0]": "TEST",
  "object[0]": {
    "test": "TEST"
  }
};
  1. Go to localhost:4200
  2. The field "Test 0" will now contain the value "TEST" and you can now change this value
  3. The field "Object 0 Test" will now contain the value "TEST" and you can NOT change this value

Screenshots

No response

In which browser are you experiencing the issue?

Google Chrome 110.0.5481.178

Which Version of JSON Forms are you using?

v3.0.0

Framework

Angular

RendererSet

Material

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions