We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2bf2d4 commit 3e8921aCopy full SHA for 3e8921a
dropdown/src/dropdown.jsx
@@ -8,7 +8,10 @@ var ListItem = require('./list-item');
8
9
module.exports = React.createClass({
10
handleClick: function() {
11
- alert('hello from dropdown');
+ this.setState({open: !this.state.open});
12
+ },
13
+ getInitialState: function(){
14
+ return { open: false }
15
},
16
render: function() {
17
var list = this.props.items.map(function(item){
@@ -22,7 +25,7 @@ module.exports = React.createClass({
22
25
title={this.props.title}
23
26
subTitleClassName="caret"
24
27
/>
- <ul>
28
+ <ul className={"dropdown-menu " + (this.state.open ? "show" : "") }>
29
{list}
30
</ul>
31
</div>
0 commit comments