Add typing outside focus on msg feild (#112)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
@@ -6,11 +6,24 @@ function listenKeyboard(event) {
|
||||
if (event.ctrlKey) {
|
||||
// k - for search Modal
|
||||
if (event.keyCode === 75) {
|
||||
if (navigation.isRawModalVisible) return;
|
||||
event.preventDefault();
|
||||
if (navigation.isRawModalVisible) return;
|
||||
openSearch();
|
||||
}
|
||||
}
|
||||
if (!event.ctrlKey && !event.altKey) {
|
||||
if (navigation.isRawModalVisible) return;
|
||||
if (['input', 'textarea'].includes(document.activeElement.type)) {
|
||||
return;
|
||||
}
|
||||
if (event.keyCode < 48
|
||||
|| (event.keyCode >= 91 && event.keyCode <= 93)
|
||||
|| (event.keyCode >= 112 && event.keyCode <= 183)) {
|
||||
return;
|
||||
}
|
||||
const msgTextarea = document.getElementById('message-textarea');
|
||||
msgTextarea?.focus();
|
||||
}
|
||||
}
|
||||
|
||||
function initHotkeys() {
|
||||
|
||||
Reference in New Issue
Block a user