1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-04 11:51:45 +03:00

Fix the ctrl+k shortcut

Fixes https://github.com/vector-im/riot-web/issues/9029
This commit is contained in:
David Baker
2019-03-06 14:53:52 +00:00
parent ce1a985233
commit 3a41206e90
2 changed files with 14 additions and 0 deletions

View File

@@ -30,6 +30,17 @@ module.exports = React.createClass({
onCleared: PropTypes.func,
className: PropTypes.string,
placeholder: PropTypes.string.isRequired,
// If true, the search box will focus and clear itself
// on room search focus action (it would be nicer to take
// this functionality out, but not obvious how that would work)
enableRoomSearchFocus: PropTypes.bool,
},
getDefaultProps: function() {
return {
enableRoomSearchFocus: false,
};
},
getInitialState: function() {
@@ -47,6 +58,8 @@ module.exports = React.createClass({
},
onAction: function(payload) {
if (!this.props.enableRoomSearchFocus) return;
switch (payload.action) {
case 'view_room':
if (this.refs.search && payload.clear_search) {