formio / formio.js

JavaScript powered Forms with JSON Form Builder

Home Page:https://formio.github.io/formio.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CheckBox Component hidelabel is not working in DataGrid Component

nishit4777 opened this issue · comments

Environment:

Steps to Reproduce

  1. Add a data grid component.
  2. Inside the data grid component add few components such as text field component, radio component & checkbox component.
  3. Select hide label inside each of the components.
  4. You will see the labels being hidden inside text field, radio components but still visible in check box component.
  5. I also suspect the fix of this issue is that we have to disable check in show label in DataGrid which is enabled when we load the components. For the other components it disabled by default.
  6. This will be a workaround, but the template behavior of the components should be similar to all.

Expected behavior

As I mentioned this workaround will be fine, but the template behavior of the components should be similar to all. On creating the check box component, it should not have show label in DataGrid value enabled or it should hide label inside data grid when the option is selected.

Observed behavior

labels being hidden inside text field, radio components but still visible in check box component.

Attaching GIF

DataGrid-checkBox - Defect

Form Json

  "display": "form",
  "components": [
    {
      "label": "Data Grid",
      "reorder": false,
      "addAnotherPosition": "bottom",
      "layoutFixed": false,
      "enableRowGroups": false,
      "initEmpty": false,
      "tableView": false,
      "defaultValue": [
        {}
      ],
      "key": "dataGrid",
      "type": "datagrid",
      "input": true,
      "components": [
        {
          "label": "Text Field",
          "applyMaskOn": "change",
          "hideLabel": true,
          "tableView": true,
          "key": "textField",
          "type": "textfield",
          "input": true
        },
        {
          "label": "Checkbox",
          "hideLabel": true,
          "tableView": false,
          "key": "checkbox",
          "type": "checkbox",
          "input": true,
          "defaultValue": false
        },
        {
          "label": "Radio",
          "optionsLabelPosition": "right",
          "inline": false,
          "hideLabel": true,
          "tableView": false,
          "values": [
            {
              "label": "",
              "value": "1",
              "shortcut": ""
            }
          ],
          "key": "radio",
          "type": "radio",
          "input": true
        }
      ]
    },
    {
      "type": "button",
      "label": "Submit",
      "key": "submit",
      "disableOnInvalid": true,
      "input": true,
      "tableView": false
    }
  ]
}

I agree that the use of "Show label in Data Grid" is bad UI, but that is currently how it is implemented and it works as designed. Closing as "won't fix"