formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

[BUG] Unable to edit item inside column

Open CoreNetJC opened this issue 6 years ago • 4 comments

Environment

Please provide as many details as you can:

  • Hosting type
    • [] Form.io
    • [x ] Local deployment
      • Version: Only using form builder with our custom framework
  • Formio.js version: 4.10
  • Frontend framework: Bootstrap 3
  • Browser: Chrome (Mac)
  • Browser version: 83.0.4103.97

Steps to Reproduce

  1. Create a form with a column component (default of 2 columns is fine)
  2. Drag a new element (text field in our case) in it and click save.
  3. Click gear icon for new element and try to change something (label for us - trying to change text) and click save.

Expected behavior

Should close modal window and new changes should be showing in form with no javascript error.

Observed behavior

Modal window closes and shows the component (text field) as it was prior to the edit. There is a javascript error that says, "Uncaught TypeError: Cannot read property '0' of undefined"

I can drag that same component out of the column, make an edit with gear icon, then drag it back into the column. I just cannot make the edit to the component directly inside the column.

Example

If possible, please provide a screenshot, live example (via JSFiddle or similar), and/or example code to help demonstrate the issue.

For code or form JSON, please enclose in a code block:

https://jsfiddle.net/nz1bur7c/

Our very simple JSON example is here and a jsfiddle is above showing the problem

{
    "components": [
        {
            "label": "Before selecting your MOOD (COLOR), is there anything you would like to communicate to your peers?",
            "labelPosition": "left-left",
            "optionsLabelPosition": "right",
            "inline": true,
            "tableView": false,
            "defaultValue": "no",
            "values": [
                {
                    "label": "Yes",
                    "value": "yes",
                    "shortcut": ""
                },
                {
                    "label": "No",
                    "value": "no",
                    "shortcut": ""
                }
            ],
            "key": "beforeSelectingYourMoodColorIsThereAnythingYouWouldLikeToCommunicateToYourPeers",
            "type": "radio",
            "labelWidth": 50,
            "input": true
        },
        {
            "label": "Columns",
            "columns": [
                {
                    "components": [
                        {
                            "label": "Text Field 4",
                            "tableView": true,
                            "key": "textField4",
                            "type": "textfield",
                            "input": true,
                            "hideOnChildrenHidden": false
                        },
                        {
                            "input": true,
                            "key": "textField",
                            "tableView": true,
                            "label": "Text Field",
                            "type": "textfield",
                            "hideOnChildrenHidden": false
                        }
                    ],
                    "width": 6,
                    "offset": 0,
                    "push": 0,
                    "pull": 0,
                    "size": "md"
                },
                {
                    "components": [],
                    "width": 6,
                    "offset": 0,
                    "push": 0,
                    "pull": 0,
                    "size": "md"
                }
            ],
            "tableView": false,
            "key": "columns",
            "type": "columns",
            "input": false
        },
        {
            "label": "Communication",
            "placeholder": "text entry",
            "autoExpand": false,
            "tableView": true,
            "key": "communication",
            "conditional": {
                "show": true,
                "when": "beforeSelectingYourMoodColorIsThereAnythingYouWouldLikeToCommunicateToYourPeers",
                "eq": "yes"
            },
            "type": "textarea",
            "input": true
        },
        {
            "type": "button",
            "label": "Submit",
            "key": "submit",
            "disableOnInvalid": true,
            "input": true,
            "tableView": false
        }
    ]
}

CoreNetJC avatar Jun 11 '20 18:06 CoreNetJC

Hello @ProteanHub thank you for reaching out! We are able to replicate this issue and have created a ticket for this issue. For reference, the ticket number is FJS-1004.

We will let you know once this issue is resolved.

wag110894 avatar Jun 11 '20 20:06 wag110894

Thanks, appreciate all your hard work with formio!

CoreNetJC avatar Jun 11 '20 20:06 CoreNetJC

We will have someone fix this as a top priority since it is a bad regression.

travist avatar Jun 11 '20 21:06 travist

Fixed in latest version.

travist avatar Jun 13 '20 13:06 travist