Skip to content

Commit e640f65

Browse files
committed
add close button to room search filter
1 parent 8a9c85c commit e640f65

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

‎src/components/structures/SearchBox.js‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ module.exports = React.createClass({
8181
var searchControls;
8282
if (!this.props.collapsed) {
8383
searchControls = [
84+
this.state.searchTerm.length > 0 ?
85+
<div key="button"
86+
className="mx_SearchBox_closeButton"
87+
onClick={ ()=>{ this.refs.search.value = ""; this.onChange(); } }>
88+
<TintableSvg
89+
className="mx_SearchBox_searchButton"
90+
src="img/icons-close.svg" width="24" height="24"
91+
/>
92+
</div>
93+
:
8494
<TintableSvg
8595
key="button"
8696
className="mx_SearchBox_searchButton"

‎src/skins/vector/css/matrix-react-sdk/structures/SearchBox.css‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ limitations under the License.
2828

2929
.mx_SearchBox_searchButton {
3030
margin-right: 10px;
31+
pointer-events: none;
32+
}
33+
34+
.mx_SearchBox_closeButton {
35+
cursor: pointer;
3136
}
3237

3338
.mx_SearchBox_search {
Lines changed: 23 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)