mirror of
				https://github.com/cinnyapp/cinny.git
				synced 2025-11-04 14:30:29 +03:00 
			
		
		
		
	Fix edit message not working (#552)
This commit is contained in:
		
							parent
							
								
									a6fdf9010b
								
							
						
					
					
						commit
						1bdd0449e0
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -41,14 +41,17 @@ function listenKeyboard(event) {
 | 
			
		|||
    if (event.code === 'KeyV') {
 | 
			
		||||
      if (navigation.isRawModalVisible) return;
 | 
			
		||||
      const msgTextarea = document.getElementById('message-textarea');
 | 
			
		||||
      if (document.activeElement !== msgTextarea && document.activeElement.tagName.toLowerCase() === 'input') return;
 | 
			
		||||
      const { activeElement } = document;
 | 
			
		||||
      if (activeElement !== msgTextarea
 | 
			
		||||
        && ['input', 'textarea'].includes(activeElement.tagName.toLowerCase())
 | 
			
		||||
      ) return;
 | 
			
		||||
      msgTextarea?.focus();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (!event.ctrlKey && !event.altKey && !event.metaKey) {
 | 
			
		||||
    if (navigation.isRawModalVisible) return;
 | 
			
		||||
    if (document.activeElement.tagName.toLowerCase() === 'input') {
 | 
			
		||||
    if (['input', 'textarea'].includes(document.activeElement.tagName.toLowerCase())) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue