Skip to content

Commit 419dc88

Browse files
author
Fabian Nickel
committed
implement node id
1 parent d26e8da commit 419dc88

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

src/components/MuiTreeView/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const tree = [
2525
<MuiTreeView
2626
defaultExpanded
2727
onLeafClick={(node) => alert(`${JSON.stringify(node)}`)}
28-
highlightId="test"
2928
tree={tree}
3029
/>
3130
```

src/components/MuiTreeView/index.jsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ const styles = theme => ({
6161
maxWidth: '75vw',
6262
},
6363
expandIcon: {},
64-
highlightItem: {
65-
backgroundColor: 'rgb(138, 138, 138)',
66-
},
6764
});
6865

6966
/**
@@ -83,8 +80,6 @@ class MuiTreeView extends Component {
8380
expansionPanelDetailsProps: object,
8481
/** Properties applied to the ListItem element. */
8582
listItemProps: object,
86-
/** Id of a leaf which will be highlighted by adding the class */
87-
highlightId: oneOfType[(string, number)],
8883
};
8984

9085
static defaultProps = {
@@ -93,7 +88,6 @@ class MuiTreeView extends Component {
9388
expansionPanelSummaryProps: null,
9489
expansionPanelDetailsProps: null,
9590
listItemProps: null,
96-
highlightId: null,
9791
};
9892

9993
createFilteredTree = memoize(
@@ -121,7 +115,6 @@ class MuiTreeView extends Component {
121115
expansionPanelSummaryProps,
122116
expansionPanelDetailsProps,
123117
listItemProps,
124-
highlightId,
125118
...props
126119
} = this.props;
127120
const value = this.getNodeValue(node);
@@ -145,7 +138,6 @@ class MuiTreeView extends Component {
145138
value={value}
146139
onClick={() => this.handleLeafClick({ value, parent, id })}
147140
button
148-
classes={highlightId === id ? { root: classes.highlightItem } : {}}
149141
{...listItemProps}>
150142
<div className={classes.text}>{value}</div>
151143
</ListItem>

0 commit comments

Comments
 (0)