Skip to content

ComponentFlow single and multi selectItems should behave same #946

Closed
@timnick-snow

Description

@timnick-snow
        ComponentFlow flow = componentFlowBuilder.clone().reset()
                .withSingleItemSelector("single1")
                .name("Single1")
                .selectItems(singleSelectItems)
                .and()
                .withMultiItemSelector("multi1")
                .name("Multi1")
                .selectItems(multiSelectItems)
                .and()
                .build();

In multiple choice, selectItems accepts a list type, but in a single selection, it accepts a map. Map will cause the final display order to be inconsistent with the order in which it was added, which makes me confused why it was designed as a map.

btw, if you use SingleItemSelector directly without component flow, you still use list to build the selectItems. It works well without any surprises.

        SingleItemSelector<String, SelectorItem<String>> component = new SingleItemSelector<>(getTerminal(),
                singleSelectItems, "testSimple", null);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions