Merge pull request #2568 from matrix-org/bwindels/fixcollapsesearchterm
Fix: search term disappears when collapsing and expanding left panel
This commit is contained in:
commit
8598c4f9a0
2 changed files with 11 additions and 5 deletions
|
@ -199,9 +199,10 @@ const LeftPanel = React.createClass({
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const searchBox = !this.props.collapsed ?
|
const searchBox = (<SearchBox
|
||||||
<SearchBox onSearch={ this.onSearch } onCleared={ this.onSearchCleared } /> :
|
onSearch={ this.onSearch }
|
||||||
undefined;
|
onCleared={ this.onSearchCleared }
|
||||||
|
collapsed={this.props.collapsed} />);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={containerClasses}>
|
<div className={containerClasses}>
|
||||||
|
|
|
@ -95,8 +95,13 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
const TintableSvg = sdk.getComponent('elements.TintableSvg');
|
// check for collapsed here and
|
||||||
|
// not at parent so we keep
|
||||||
|
// searchTerm in our state
|
||||||
|
// when collapsing and expanding
|
||||||
|
if (this.props.collapsed) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const clearButton = this.state.searchTerm.length > 0 ?
|
const clearButton = this.state.searchTerm.length > 0 ?
|
||||||
(<AccessibleButton key="button"
|
(<AccessibleButton key="button"
|
||||||
className="mx_SearchBox_closeButton"
|
className="mx_SearchBox_closeButton"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue