formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.9k stars 1.07k forks source link

Link to jump to validation error does not work for "editgrid" input #4951

Closed chdonncha closed 9 months ago

chdonncha commented 2 years ago

When the Validation catches errors into an alert and provides links to navigate to the field like so: image

The links for the First and Last Names work since they are inputs but the Items does not using the type editgrid

If I change items to use differnet inputs such as select or input then it works but I require the editgrid in this case

Does anyone know if this is a bug or is there a workaround for this issue to make the jump to field on validation error link useable for any type:editgrid ?

My Code Looks as the following for the Items:


{
  "label": "Items",
  "labelPosition": "left-left",
  "labelWidth": 30,
  "openWhenEmpty": false,
  "tableView": false,
  "rowDrafts": false,
  "key": "items",
  "type": "editgrid",
  "displayAsTable": false,
  "input": true,
  "templates": {
    "header": "<div>test</div>",
    "row": "<div>test</div>"
  },
  "validate": {
    "required": true
  },
  "components": [
    {
      "label": "Code",
      "labelPosition": "left-left",
      "labelWidth": 30,
      "widget": "choicesjs",
      "tableView": true,
      "dataSrc": "url",
      "data": {
        "url": "/api/..."
      },
      "validate": {
        "required": true
      },
      "key": "code",
      "template": "<span>{{ item.value }} - {{ item.label }}</span>",
      "type": "select",
      "input": true,
      "lazyLoad": false,
      "disableLimit": false
    },
    {
      "label": "Quantity",
      "labelPosition": "left-left",
      "labelWidth": 30,
      "mask": false,
      "tableView": true,
      "truncateMultipleSpaces": false,
      "validate": {
        "required": true
      },
      "key": "quantity",
      "calculateValue": "{ value }",
      "type": "textfield",
      "input": true
    }
  ]
}
heather-formio commented 1 year ago

Thank you for your report. We have this issue on our backlog to resolve. We welcome a pull request as well if you are interested in contributing.

olgabann commented 9 months ago

We're currently addressing a backlog of GitHub issues. Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!