react-checkbox-tree icon indicating copy to clipboard operation
react-checkbox-tree copied to clipboard

Feature request: option to sort the nodes

Open stla opened this issue 3 years ago • 0 comments

Hello,

I have an array like this:

["Africa/Abidjan", "Africa/Accra", "America/Argentina/Cordoba", "America/Argentina/Jujuy"]

I am able to convert it to an array of nodes:

[
  {
    label: "Africa",
    value: "africa",
    children: [
      {
        label: "Abidjan",
        value: "abidjan"
      }, 
      {
        label: "Accra",
        value: "acrra"
      }
    ]
  }, 
  {
    label: "America", 
    value: "america",
    children : ......
  }
]

except that I loose the original order.

So it would be nice to have an option to sort the nodes by their label (as in jsTree), or by an optional key order.

stla avatar Jul 08 '20 09:07 stla