Prevent click handler from firing for unselectable items

This commit is contained in:
John Furrow
2016-01-09 12:23:03 -08:00
parent e1563509d2
commit 997d52f2a7

View File

@@ -86,8 +86,14 @@ export default class Dropdown extends React.Component {
'is-selectable': property.selectable !== false,
'is-selected': property.selected
})
let clickHandler = null;
if (property.selectable !== false) {
clickHandler = this.handleItemSelect.bind(this, property);
}
return (
<li className={classes} key={index} onClick={this.handleItemSelect.bind(this, property)}>
<li className={classes} key={index} onClick={clickHandler}>
{property.displayName}
</li>
);