Allow dropdown arguments to have a pre-selected option
I'm looking to have a "default" option for the dropdown argument type. This could be done by simply having another boolean field called selected for each option, besides title and value. e.g.
# @raycast.argument1 { "type": "dropdown", "placeholder": "Snack", "data": [{ "title": "Cookie", "value": "cookie", "selected": true }, { "title": "Donut", "value": "donut" }] }
Similar behaviour can currently be achieved by marking the argument as optional and setting the default in the script itself, but this approach would be more explicit to the user about what that default is.
The existence of a default/pre-selected option would also allow getting rid of the "-" option in the dropdown:
In case multiple options are marked as selected then it would make sense to just use the first one.
The name could be something else if that would make more sense. I based my choice of selected on how HTML select tags work, and how you can add a selected attribute to an option to have it be pre-selected.
cc @mathieudutour 😄
Hey @TeeSeal,
We have recorded this in our internal feature request system. Thank you for the idea/request.