Skip to content

Commit

Permalink
Hotpatch ListField
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaanCoding committed Apr 16, 2024
1 parent 1586280 commit b3af8c5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Docs/Dropdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dropdown

```json
{
"name": "Example",
"description": "An example for your project.",
"function": "exampleMacro",
"variables": [
{
"label": "Example Select List",
"name": "exampleSelectList",
"defaultValue": "example-1",
"_type": "select",
"optionsList": [
{
"label": "Example 1",
"value": "example-1"
},
{
"label": "Example 2",
"value": "example-2"
}
]
}
]
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ListField: React.FC<IListFieldProps> = ({ variables, control }) => {
})

useEffect(() => {
remove() // Remove the default value (if there was any)
if (variables.defaultValue && Array.isArray(variables.defaultValue)) {
variables.defaultValue.forEach((value) => {
append(value)
Expand Down

0 comments on commit b3af8c5

Please sign in to comment.