mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-16 20:20:29 +03:00
Fix pasting not working #551
This commit is contained in:
parent
0b70c7e490
commit
4a715bfd17
2 changed files with 12 additions and 6 deletions
|
|
@ -33,22 +33,22 @@ function listenKeyboard(event) {
|
|||
// open search modal
|
||||
if (event.code === 'KeyK') {
|
||||
event.preventDefault();
|
||||
if (navigation.isRawModalVisible) {
|
||||
return;
|
||||
}
|
||||
if (navigation.isRawModalVisible) return;
|
||||
openSearch();
|
||||
}
|
||||
|
||||
// focus message field on paste
|
||||
if (event.code === 'KeyV') {
|
||||
if (navigation.isRawModalVisible) return;
|
||||
const msgTextarea = document.getElementById('message-textarea');
|
||||
if (document.activeElement !== msgTextarea && document.activeElement.tagName.toLowerCase() === 'input') return;
|
||||
msgTextarea?.focus();
|
||||
}
|
||||
}
|
||||
|
||||
if (!event.ctrlKey && !event.altKey && !event.metaKey) {
|
||||
if (navigation.isRawModalVisible) return;
|
||||
if (['text', 'textarea'].includes(document.activeElement.type)) {
|
||||
if (document.activeElement.tagName.toLowerCase() === 'input') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue