Skip to content

Commit cb095ba

Browse files
committed
WIP search stuff
1 parent 0bfb141 commit cb095ba

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/skins/vector/views/molecules/SearchBar.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ module.exports = React.createClass({
4343
},
4444

4545
onSearchChange: function(e) {
46-
46+
if (e.keyCode === 13) {
47+
this.props.onSearch(this.refs.search_term.getDOMNode().value);
48+
}
4749
},
48-
50+
4951
render: function() {
5052
return (
5153
<div className="mx_SearchBar">
52-
<input className="mx_SearchBar_input" type="text" placeholder="Search..." onChange={this.onSearchChange}/>
54+
<input ref="search_term" className="mx_SearchBar_input" type="text" placeholder="Search..." onChange={this.onSearchChange}/>
5355
<div className={"mx_SearchBar_button" + (this.state.scope !== this.Scope.Room ? " mx_SearchBar_unselected" : "")} onClick={this.onThisRoomClick}>This Room</div>
5456
<div className={"mx_SearchBar_button" + (this.state.scope !== this.Scope.All ? " mx_SearchBar_unselected" : "")} onClick={this.onAllRoomsClick}>All Rooms</div>
5557
<img className="mx_SearchBar_cancel" src="img/cancel-black.png" width="18" height="18" onClick={this.props.onCancelClick} />

0 commit comments

Comments
 (0)