Skip to content

Commit 00dd1e1

Browse files
committed
focus message composer when window gets focus
1 parent 9f37196 commit 00dd1e1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/controllers/pages/MatrixChat.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module.exports = {
4242
}
4343
this.focusComposer = false;
4444
document.addEventListener("keydown", this.onKeyDown);
45+
window.addEventListener("focus", this.onFocus);
4546
},
4647

4748
componentWillUnmount: function() {
@@ -127,6 +128,10 @@ module.exports = {
127128
break;
128129
}
129130
}
131+
},
132+
133+
onFocus: function(ev) {
134+
dis.dispatch({action: 'focus_composer'});
130135
}
131136
};
132137

0 commit comments

Comments
 (0)