diff --git a/README.md b/README.md index e51434ec..5da20f5e 100644 --- a/README.md +++ b/README.md @@ -110,8 +110,9 @@ Individual nodes within the `nodes` property can have the following structure: | Property | Type | Description | | ----------- | ------ | ------------------------------- | -| `label` | string | **Required**. The node's label. | +| `label` | mixed | **Required**. The node's label. | | `value` | mixed | **Required**. The node's value. | | `children` | array | An array of child nodes. | | `className` | string | A className to add to the node. | +| `disabled` | bool | Disable node. | | `icon` | mixed | A custom icon for the node. | diff --git a/src/js/CheckboxTree.js b/src/js/CheckboxTree.js index 62667ec8..999be54a 100644 --- a/src/js/CheckboxTree.js +++ b/src/js/CheckboxTree.js @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import { isEqual } from 'lodash'; +import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; import shortid from 'shortid'; @@ -190,13 +190,14 @@ class CheckboxTree extends React.Component { const key = `${node.value}`; const checked = this.getCheckState(node, noCascade); const children = this.renderChildNodes(node); + const nodeDisabled = !!(disabled || node.disabled); return (