mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
focus message composer when window gets focus
This commit is contained in:
parent
9f37196eb7
commit
00dd1e180a
1 changed files with 5 additions and 0 deletions
|
@ -42,6 +42,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
this.focusComposer = false;
|
this.focusComposer = false;
|
||||||
document.addEventListener("keydown", this.onKeyDown);
|
document.addEventListener("keydown", this.onKeyDown);
|
||||||
|
window.addEventListener("focus", this.onFocus);
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
|
@ -127,6 +128,10 @@ module.exports = {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onFocus: function(ev) {
|
||||||
|
dis.dispatch({action: 'focus_composer'});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue