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

Styles

Open rschlack opened this issue 9 years ago • 1 comments

Is it possible to change CSS on a node when it's clicked? I'd like to check and uncheck items when they are selected.

rschlack avatar Nov 04 '16 13:11 rschlack

I'm not an expert with this project, but I might be able to help...

There are two ways you might be able to accomplish this. One is that selected nodes get an is-active class – if it's just styling, you should be able to work off of that.

If you want to trigger an event by adding your action to the onClickNode method. Here's what it looks like in the example:

onClickNode(node) {
    this.setState({
      active: node
    });
  },

Now... I'd like to be able to trigger an action on the end of dragging as well! That's my next job :)

shankie-codes avatar Dec 05 '16 11:12 shankie-codes