Is there any way I can focus on a choice to begin with #1312
-
let value = await arg(
[{
id: '3', name: '3', value: 3 // default focus this
}, {
id: '4', name: '4', value: 4 // but i want to focus this
}]
) |
Beta Was this translation helpful? Give feedback.
Answered by
johnlindquist
Jul 15, 2023
Replies: 1 comment 1 reply
-
Yes, you can set a let choices = ["John", "Mindy", "Ben"].map(name => {
return {
id: uuid(),
name,
value: name,
}
})
let defaultChoiceId = choices.find(choice => choice.name === "Mindy")?.id
await arg(
{
placeholder: "Pick one",
defaultChoiceId,
},
choices
) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
alkene0005
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@alkene0005
Yes, you can set a
defaultChoiceId
in the prompt config: