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

Label title uses the node text which renders [Object object] when using a React component to render the name

Open maddox opened this issue 3 years ago • 2 comments

When passing a react object for the name of the node to get special rendering, the component uses it for the hover title. This render [Object object].

It would be nice if it just didn't render this at all if the nodeText was NOT a string. Or, if we could pass our own value for the title hover text.

Example

    {
      name: (
      <>
        {setting.name}
        <OverlayTrigger placement="top" overlay={<Tooltip id={`tooltip-issue`}>{setting.description}</Tooltip>}>
          <FontAwesomeIcon icon={faInfoCircle} className="ml-2" />
        </OverlayTrigger>
      </>
    ),
    id: setting.settingKey,
  }

Code Location

https://github.com/azizali/react-super-treeview/blob/master/src/index.js#L234-L238

  <label
      htmlFor={node.id}
      title={nodeText}
      className="super-treeview-text"
  >

https://github.com/azizali/react-super-treeview/blob/master/src/index.js#L234-L238

maddox avatar Aug 23 '22 20:08 maddox

Hey, did you ever find a way around this? Got the same issue we could do with sorting.

lucasblackhurst avatar Sep 10 '24 16:09 lucasblackhurst

No, I think I just wrapped the component and handled it myself.

maddox avatar Sep 10 '24 16:09 maddox