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

Vertical layout option

Open kennyhuynh125 opened this issue 5 years ago • 3 comments

Wondering if it is possible to have the same functionality but instead of having the top level nodes go from top to bottom, can it be vertical?

For example: Current layout is like this:

- RootLevel1
  - Children
- RootLevel2
  - Children
- RootLevel3
  - Children

Is it possible to make it like this?

- RootLevel1    - RootLevel2    -RootLevel3
   - Children      - Children    - Children

Thanks!

kennyhuynh125 avatar Dec 17 '19 19:12 kennyhuynh125

There is not an option currently.

For your desired layout, how would nested children be handled? I must admit I am somewhat struggling to imagine how it would play out. Would these children revert to what currently exists in this library, such that only the top level nodes are arranged differently from the rest?

That is, would this layout result in the following?:

- RootLevel1        - RootLevel2        - RootLevel3
  - Child1            - Child1            - Child1
    - NestedChild1    - Child2              - NestedChild1
    - NestedChild2      - NestedChild1      - NestedChild2
  - Child2              - NestedChild2    - Child2

jakezatecky avatar Dec 20 '19 19:12 jakezatecky

@jakezatecky Yes, you have that layout correct; that is what I am looking for!

kennyhuynh125 avatar Dec 24 '19 23:12 kennyhuynh125

@kennyhuynh125 you could apply the style display: flex to the top-level ol element through CSS, such as:

.react-checkbox-tree > ol {
  display: flex;
}

That should achieve the layout you are looking for. Is that an acceptable solution?

jakezatecky avatar Dec 26 '19 17:12 jakezatecky