Skip to content

PlutoUI's Select type has the order of the pairs wrong #159

@KronosTheLate

Description

@KronosTheLate

Copy of this discourse post:

The Select type allows the user to create down-down menus with the @bind macro. Awesome feature.
The current behaviour is
image|690x126, 75%

The docs for Select look like this:
image

So in the language of the docs, "1" is the key, and "one" is the value. key=>value is consistent with Dict, and feels right. But it feels to me as the entry visible in the drop-down is the key, used to index to the right value. The key has a name that makes sense, but the value is what you are really interested in. But currently, the opposite is the case.

Additionally, keys are of type string, but values are of type any. I want variables to have any type, but drop-down entries to have type String. The other way around, which is currently the case, makes no sense:
image

Could I be right in saying that the first value, the key of type String, should be shown in the drop-down? And that the second value, the value of type Any, should be bound to the variable? It makes more sense, and is a lot more powerful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions