diff --git a/components/filterList.js b/components/filterList.js index 3aa2e05..fe3ba77 100644 --- a/components/filterList.js +++ b/components/filterList.js @@ -10,14 +10,14 @@ let FilterList = create({ getInitialState: function() { return { - selection: -1, + selection: 0, filter: "" } }, select: function(id) { this.setState({selection: id}) - this.props.callback(id) + //this.props.callback(id) }, inputRef: function(ref) { @@ -39,7 +39,7 @@ let FilterList = create({ render: function() { let items = this.props.items.map((item, id) => { let props = { - active: this.state.selection == id, + selected: this.state.selection == id, filter: this.state.filter, content: item, key: id, diff --git a/components/sidebar.js b/components/sidebar.js index 3dec2db..ca0cc28 100644 --- a/components/sidebar.js +++ b/components/sidebar.js @@ -22,7 +22,7 @@ let RoomListItem = create({ return } this.setState({ref: ref}) - ref.addEventListener("click", () => {this.props.select(this.props.roomId)}) + ref.addEventListener("click", () => {this.props.select(this.props.listId)}) }, render: function() { @@ -30,7 +30,7 @@ let RoomListItem = create({ return null } let className = "roomListItem" - if (this.props.active) { + if (this.props.selected) { className += " active" } if (this.state.unread) {