Skip to content

Commit 4418f83

Browse files
committed
docs: list conditional wrapper attributes in a table
1 parent c6887ad commit 4418f83

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎docs/basic-usage/conditional-wrapper.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ In the example below, `expires_at` will be disabled and hidden unless the `quiz`
1717
```
1818

1919
The conditional wrapper supports the following attributes:
20-
- `'enable-elem'` - (Required) The selector of the input element's value which is used for the condition
21-
- `'enable-value'` - (Required) Which value when selected should the section be enabled. Can accept arrays as well.
22-
- `'hide-fields'` - Whether the fields should also be hidden when they are disabled. Default is `false`.
23-
- `'disable'` - Setting this to `true` will invert the behaviour. i.e The section will get disabled if the given value is selected.
24-
- `'json-encode'` - Whether to json encode the given value. Default is `true` if the given value is an array, otherwise it's false.
20+
21+
| Attribute | Default | Description |
22+
| --- | --- | --- |
23+
| `enable-elem` | **Required** | Selector of the input element whose value is used for the condition. |
24+
| `enable-value` | **Required** | Value that enables the section when selected. Accepts arrays as well. |
25+
| `hide-fields` | `false` | Whether to also hide the fields when they are disabled. |
26+
| `disable` | `false` | Inverts the behaviour: disables the section when the given value is selected. |
27+
| `enable-checkbox` | `false` | Uses the checked status of the checkbox selected by `enable-elem` to control the section. |
28+
| `json-encode` | `true` for arrays, otherwise `false` | Whether to JSON encode `enable-value`. |
2529

2630

2731
## Disabling an input field depending on a checkbox status

0 commit comments

Comments
 (0)