Merge pull request #2015 from bartvanandel/fix/use-default-index-in-option-transform
This commit is contained in:
commit
5d3353189b
@ -74,11 +74,11 @@ function transformArgs(opArgsList, newArgs) {
|
|||||||
return opArgs.map((arg) => {
|
return opArgs.map((arg) => {
|
||||||
if (arg.type === "option") {
|
if (arg.type === "option") {
|
||||||
// pick default option if not already chosen
|
// pick default option if not already chosen
|
||||||
return typeof arg.value === "string" ? arg.value : arg.value[0];
|
return typeof arg.value === "string" ? arg.value : arg.value[arg.defaultIndex ?? 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg.type === "editableOption") {
|
if (arg.type === "editableOption") {
|
||||||
return typeof arg.value === "string" ? arg.value : arg.value[0].value;
|
return typeof arg.value === "string" ? arg.value : arg.value[arg.defaultIndex ?? 0].value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg.type === "toggleString") {
|
if (arg.type === "toggleString") {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user