Skip to content

Commit

Permalink
Fixed #842 - Added contentStyle and contentClassName to Tree
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Apr 12, 2019
1 parent 5db357c commit d20ff82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/tree/Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export class Tree extends Component {
expandedKeys: null,
style: null,
className: null,
contentStyle: null,
contentClassName: null,
metaKeySelection: true,
propagateSelectionUp: true,
propagateSelectionDown: true,
Expand Down Expand Up @@ -48,6 +50,8 @@ export class Tree extends Component {
expandedKeys: PropTypes.object,
style: PropTypes.object,
className: PropTypes.string,
contentStyle: PropTypes.object,
contentClassName: PropTypes.string,
metaKeySelection: PropTypes.bool,
propagateSelectionUp: PropTypes.bool,
propagateSelectionDown: PropTypes.bool,
Expand Down Expand Up @@ -366,9 +370,10 @@ export class Tree extends Component {
renderModel() {
if (this.props.value) {
const rootNodes = this.renderRootChildren();
let contentClass = classNames('p-tree-container', this.props.contentClassName);

return (
<ul className="p-tree-container" role="tree" aria-label={this.props.ariaLabel} aria-labelledby={this.props.ariaLabelledBy}>
<ul className={contentClass} role="tree" aria-label={this.props.ariaLabel} aria-labelledby={this.props.ariaLabelledBy} style={this.props.contentStyle}>
{rootNodes}
</ul>
);
Expand Down

0 comments on commit d20ff82

Please sign in to comment.