React-select: Allow nested options

Created on 15 May 2015  路  4Comments  路  Source: JedWatson/react-select

Would be awesome to have nested options within options.

var options = [
  {
    value: 'one',
    label: 'One',
    options: [
      value: 'n-one',
      label: 'Nested One'
    ]
  }
];

When an option has more possible options, there would be a more property which indicates to the user that they need to perform a action to return more results or something similar. Render if options available otherwise if more is set, retrieve more options.

Most helpful comment

Optgroup implementations get really hard to maintain. Isn't this solvable by just representing the hierarchy in the label? With custom rendering (https://github.com/JedWatson/react-select/pull/216) rendering out a good breadcrumb wouldn't be hard at all.

All 4 comments

Could you give a real world example of this? I'm struggling to understand where it might be useful.

Nested options would allow you to do something like this:
image

Optgroup implementations get really hard to maintain. Isn't this solvable by just representing the hierarchy in the label? With custom rendering (https://github.com/JedWatson/react-select/pull/216) rendering out a good breadcrumb wouldn't be hard at all.

But still, you can't get a title for optgroup with custom render

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sampatbadhe picture sampatbadhe  路  3Comments

MalcolmDwyer picture MalcolmDwyer  路  3Comments

yrabinov picture yrabinov  路  3Comments

steida picture steida  路  3Comments

Meesam picture Meesam  路  3Comments