-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vector
of Pair
s for PlutoUI.Select
not parsed properly?
#118
Comments
If you see from the documentation open on the helpbox it does mention that what is returned from the |
Exactly. Note that the type of the argument is options = ["1" => "one", "2" => "two"]
@bind selectedkey Select(options, default=options[1][1])
--- # Another cell
value = options[ findfirst(x -> first(x) === selectedkey, options)][2] |
Thanks guys. Yes, I did notice the help doc, and I was wondering if it was just a mistaken decision, or optimal given the context of a notebook. Is it designed this way because in Pluto notebooks, you cannot assign, say, a custom type to the Also, what is the purpose of having each
because of course I'd be happy to close this issue seeing as this design seems intentional, but just wanted to check and ask if it's possible to design it the more intuitive way. |
FWIW, I use the following pattern with basically all
It would be nice if there was an API that achieved this directly in the |
Or am I doing something wrong?
The
options
input should be of the form["Display Value" => assigned_value]
withassigned_value isa Any
, right?The text was updated successfully, but these errors were encountered: