mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
Merge pull request #2759 from matrix-org/dbkr/fix_ctrl_k
Fix the ctrl+k shortcut
This commit is contained in:
commit
1a7c313de7
@ -213,6 +213,7 @@ const LeftPanel = React.createClass({
|
||||
);
|
||||
|
||||
const searchBox = (<SearchBox
|
||||
enableRoomSearchFocus={true}
|
||||
placeholder={ _t('Filter room names') }
|
||||
onSearch={ this.onSearch }
|
||||
onCleared={ this.onSearchCleared }
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user