react-accessible-treeview icon indicating copy to clipboard operation
react-accessible-treeview copied to clipboard

How do add classes to the leafListItem (li element)

Open davecarlson opened this issue 2 years ago • 1 comments

Describe the bug Cannot style at the

  • level

    Code That Causes The Issue Missing option

    To Reproduce Create a default TreeView

    Expected behavior prop to liClassName

    Would it be possible to expose a prop that allows us to inject a classname into each of the

  • components ? Rational - we use tailwind for styling, and want to be able to alernate the colours of the rows. At the moment we cannot do this without writing raw css on the .tree-branch-wrapper , as the nodeRender is one level down the tree, so nth-child(odd), even etc will not work as there's only one node at that level:
    <ul
      class="tree"
      role="tree"
      aria-multiselectable="false"
      aria-label="location treer"
    >
      <li
        role="treeitem"
        aria-expanded="true"
        aria-setsize="2"
        aria-posinset="1"
        aria-level="1"
        aria-disabled="false"
        tabindex="0"
        class="tree-branch-wrapper"
      >
        <div
          class="tree-node tree-node--expanded tree-node__branch"
          style="padding-left: 0px"
        >
        Node
    </div>
    </li>
    </ul>
    
  • davecarlson avatar Mar 06 '24 16:03 davecarlson

    We’re open to a PR, but our core team doesn’t have this need so we wouldn’t be writing the PR ourselves to due internal company priority.

    dgreene1 avatar Mar 06 '24 17:03 dgreene1

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    stale[bot] avatar May 05 '24 20:05 stale[bot]

    This issue was closed automatically since it was marked as stale because it has not had recent activity. Thank you for your contributions.

    stale[bot] avatar May 13 '24 02:05 stale[bot]