Skip to content
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

select should accept array as option #1296

Closed
slashwhatever opened this issue Jun 16, 2017 · 3 comments
Closed

select should accept array as option #1296

slashwhatever opened this issue Jun 16, 2017 · 3 comments

Comments

@slashwhatever
Copy link

slashwhatever commented Jun 16, 2017

Here's some code that outlines what I would love to be able to do:

const _imageSets = {
  'cage': [
    'https://www.placecage.com/c/200/300',
    'https://www.placecage.com/c/245/100',
    'https://www.placecage.com/c/250/300',
    'https://www.placecage.com/c/200/300',
    'https://www.placecage.com/c/200/200',
    'https://www.placecage.com/c/300/340',
    'https://www.placecage.com/c/200/300',
    'https://www.placecage.com/c/400/350',
    'https://www.placecage.com/c/200/200',
    'https://www.placecage.com/c/500/100',
  ],
  'bill': [
    'https://www.fillmurray.com/g/200/300',
    'https://www.fillmurray.com/g/245/100',
    'https://www.fillmurray.com/g/250/300',
    'https://www.fillmurray.com/g/200/300',
    'https://www.fillmurray.com/g/200/200',
    'https://www.fillmurray.com/g/300/340',
    'https://www.fillmurray.com/g/200/300',
    'https://www.fillmurray.com/g/400/350',
    'https://www.fillmurray.com/g/200/200',
    'https://www.fillmurray.com/g/500/100',
  ]
}

return (
  <SimpleCarousel
    showDots={boolean('show dots?', false)}
    showArrows={boolean('show arrows?', false)}
    slides={select('images', _imageSets, 'cage')}
  />
)

User selects 'cage' or 'bill' in the dropdown and the slides prop is passed the array of images relating to their choice.

Right now it, this is what I get: https://puu.sh/wlwLS/5942359d38.png

The select gets passed the array as it's display value: https://puu.sh/wlwN6/ae1ea14c21.png

@ndelangen
Copy link
Member

Related: #799

@stale
Copy link

stale bot commented Nov 14, 2017

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks!

@stale stale bot added the inactive label Nov 14, 2017
@stale
Copy link

stale bot commented Nov 29, 2017

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants