Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
maddox opened this issue Aug 23, 2022 · 2 comments

Comments

@maddox
Copy link

maddox commented Aug 23, 2022

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

@lucasblackhurst
Copy link

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

@maddox
Copy link
Author

maddox commented Sep 10, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants