storybook-eol/react-treebeard

[Question] Is it possible to expand node without selecting it?

mindaugasnakrosis opened this issue · 15 comments

Is it possible to expand a row without selecting it?

@maximilianoforlenza @cancerberoSgx @navarroaxel

Hi @mindaugasnakrosis! Do you want to expand the row when the mouse is hover on it?

@maximilianoforlenza Current problems is that expand node and select it, are the same operations currently. Would it be possible to separate them?

What I mean by that is only expanding the node, but not selecting it and other way around, clicking on it, selecting it, but not expanding/closing it.

Basically is it possible to do it like in this gif? This is done using another library.

ezgif com-video-to-gif

@RokasVaitkevicius what library is that?

@maximilianoforlenza https://github.com/chenglou/react-treeview

But it is not maintained anymore, so difficult to use.

We need the ability to:

  • expand the node (one action)
  • select the row (another action)

ok. Yes it is possible. I'll start to work on it.

@maximilianoforlenza amazing! Looking forward to the changes.

@maximilianoforlenza how is it going? Maybe you need some help?

hi @mindaugasnakrosis ! I've published a new release https://github.com/storybookjs/react-treebeard/releases/tag/v4.2.4-beta.0 this is a beta version.

Now you have a new prop called onSelect this prop send the node selected. Here is an example https://github.com/storybookjs/react-treebeard/blob/master/example/app.js and you have customStyles prop if you want to change the title color.

please give me your feedback, if is ok I'll fix test and I'll publish stable version.

At first glance everything looks amazing, we will investigate further and let you know our final feedback.

Thanks a ton!

@maximilianoforlenza everything is perfect! Thanks again, will be closing it now.

@mindaugasnakrosis Thanks! I'll fix the unit test and then I'll publish a new version (5.0.0).

Is this new version published? I have version 3.2.4 and onSelect doesn't work. And I don't see onSelect in the ReadMe, either.

If you want to have it, you have to use version "^4.2.4-beta.0". It has onSelect and onToggle separated and available. I don't know when it will be published and go out of beta.

Thanks for the hint. It works well! (Correction of the previous version of this comment.)

I appreciate the new function.