Open drunkenvalley opened 1 year ago
ZOMG!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.10 containing PR #22169 that references this issue. Upgrade today to the @future
NPM tag to try it out!
npx sb@next upgrade --tag future
Closing this issue. Please re-open if you think there's still more to do.
ZOMG!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.8 containing PR #22169 that references this issue. Upgrade today to the @latest
NPM tag to try it out!
npx sb@latest upgrade
Describe the bug
Using a multi-select control such as
multi-select
,check
, etc, will cause the mapped argument to only return an array containing the labels of the arguments.For example, using the example on Dealing with complex values we have this story:
In the given example with the control's
type
set toselect
, selecting an item returns that item. For example, selecting "Up" will returnArrowUp
.However, if we replace that control's
type
tomulti-select
, selecting an additional item will return an array of labels instead, not an array of the selected items. For example, selecting "Up" and "Down" will return["Up", "Down"]
instead. (Or it should. I only tested with implicit labels. It may return["ArrowUp", "ArrowDown"]
instead.)Current behavior:
When selecting one item it will return the object containing that item. When selecting multiple it returns an array of the options' labels.
Expected behavior:
When selecting one item it should return the object containing that item. When selecting multiple it should return an array or object containing all selected values.
Alternatively, when using controls allowing selecting multiple it should always return an array containing the selected objects.
To Reproduce
See reproduction stackblitz here: https://stackblitz.com/edit/github-yw4xwr?file=src/stories/List.stories.ts
System
Additional context
Reproduction should show as following.
No items
One item
Two items
Updated System info to result from reproduction repo.