Support mark as read by ESC while in room input (#669)
fixes #cinnyapp/cinny/668
This commit is contained in:
@@ -51,9 +51,6 @@ function listenKeyboard(event) {
|
|||||||
|
|
||||||
if (!event.ctrlKey && !event.altKey && !event.metaKey) {
|
if (!event.ctrlKey && !event.altKey && !event.metaKey) {
|
||||||
if (navigation.isRawModalVisible) return;
|
if (navigation.isRawModalVisible) return;
|
||||||
if (['input', 'textarea'].includes(document.activeElement.tagName.toLowerCase())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.code === 'Escape') {
|
if (event.code === 'Escape') {
|
||||||
if (navigation.isRoomSettings) {
|
if (navigation.isRoomSettings) {
|
||||||
@@ -66,6 +63,10 @@ function listenKeyboard(event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (['input', 'textarea'].includes(document.activeElement.tagName.toLowerCase())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// focus the text field on most keypresses
|
// focus the text field on most keypresses
|
||||||
if (shouldFocusMessageField(event.code)) {
|
if (shouldFocusMessageField(event.code)) {
|
||||||
// press any key to focus and type in message field
|
// press any key to focus and type in message field
|
||||||
|
|||||||
Reference in New Issue
Block a user