jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

Cannot enter values in field with brackets in property name

Open PimRheiter opened this issue 2 years ago • 2 comments

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

PimRheiter avatar Feb 27 '23 14:02 PimRheiter

Thanks for the report!

sdirix avatar Mar 09 '23 11:03 sdirix

Hey @sdirix checking on this issue isn't this supposed to be fixed with Custom renderer? Since your'e trying to access data at 0th index here test[0] cant we just integrate custom renderer and then have this working by updating the props value?

howdyAnkit avatar Aug 22 '23 15:08 howdyAnkit