How to fill background color of a node
See original GitHub issueI would like to fill node background with another color other than white, however seems like not able to. Here is what I did.
<SortableTree
treeData={this.state.treeData}
onChange={treeData => this.setState({ treeData })}
canDrag = {false}
getNodeKey = {({node})=> node.id}
generateNodeProps={(({ node, path, treeIndex}) => {
return ({
title: (
<div style={{height:'100%', width:'100%', backgroundColor:'cyan'}} >
<Checkbox
label= {node.name}
/>
</div>),})}}
/>
and this is how it looks. (I want color fill all the node background)
Please let me know how to resolve it.
thank you so much.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Get and set node background color : backgroundColor « Style «
Get and set node background color : backgroundColor « Style « JavaScript Tutorial.
Read more >fillcolor | Graphviz
fillcolor. Color used to fill the background of a node or cluster. type: color | colorList, default: lightgrey (nodes) , black (clusters).
Read more >Using Nodelists to Change Background Color of Page
You are passing a single node to color() but then trying to iterate over it with a for() call. You are using getElementsByTagName()...
Read more >Tikz background color of node multilayer - TeX
Normal node behavior is to have no background color. Try adding fill=white to the small square. – Alain Merigot. Sep 27, 2019 at...
Read more >How to change the node background color and picture when ...
How to change the node background color and picture when click node? ... var color = "#302e2f3d"; if (shape) { shape.fill = GO(go....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, the reason behind that is that props returned from generateNodeProps are applied to the whole node “row” container, and not the node contents. If you look closely, you may notice that the background color applied via the style prop is “shining through” at the rounded edges of the drag handle and the node contents rectangles (only).
You could work around this by either creating a custom nodeContentRenderer (see node-renderer-default.js for the default renderer), or by defining CSS classes which target the node content element.
Example for the latter:
JSX prop
generateNodeProps={ () => ({ className: 'red-node' }) }
CSS class
Hi, I am having the same issue, using background / backgroundColor doesn’t have any effect.