mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
persist search filter over being hidden
This commit is contained in:
parent
65d9333104
commit
d512e25cca
@ -29,11 +29,21 @@ module.exports = React.createClass({
|
|||||||
onSearch: React.PropTypes.func,
|
onSearch: React.PropTypes.func,
|
||||||
},
|
},
|
||||||
|
|
||||||
onChange: new rate_limited_func(
|
getInitialState: function() {
|
||||||
|
return {
|
||||||
|
searchTerm: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
onChange: function() {
|
||||||
|
if (!this.refs.search) return;
|
||||||
|
this.setState({ searchTerm: this.refs.search.value });
|
||||||
|
this.onSearch();
|
||||||
|
},
|
||||||
|
|
||||||
|
onSearch: new rate_limited_func(
|
||||||
function() {
|
function() {
|
||||||
if (this.refs.search) {
|
|
||||||
this.props.onSearch(this.refs.search.value);
|
this.props.onSearch(this.refs.search.value);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
100
|
100
|
||||||
),
|
),
|
||||||
@ -81,6 +91,7 @@ module.exports = React.createClass({
|
|||||||
type="text"
|
type="text"
|
||||||
ref="search"
|
ref="search"
|
||||||
className="mx_SearchBox_search"
|
className="mx_SearchBox_search"
|
||||||
|
value={ this.state.searchTerm }
|
||||||
onChange={ this.onChange }
|
onChange={ this.onChange }
|
||||||
placeholder="Search room names"
|
placeholder="Search room names"
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user