Word break
This commit is contained in:
		
							parent
							
								
									7526bcc816
								
							
						
					
					
						commit
						1999a6c8d8
					
				| @ -31,11 +31,14 @@ class ChatInputElement extends HTMLElement { | |||||||
|             this.dispatchEvent(new CustomEvent("change", { detail: e.target.value, bubbles: true })) |             this.dispatchEvent(new CustomEvent("change", { detail: e.target.value, bubbles: true })) | ||||||
|             console.error(e.target.value) |             console.error(e.target.value) | ||||||
|         }) |         }) | ||||||
|         this.textBox.addEventListener('keyup', (e) => { |         this.textBox.addEventListener('keydown', (e) => { | ||||||
|             e.preventDefault() | 
 | ||||||
|             if (e.key == 'Enter' && !e.shiftKey) { |             if (e.key == 'Enter') { | ||||||
|                 this.dispatchEvent(new CustomEvent("submit", { detail: e.target.value, bubbles: true })) |                 if(!e.shiftKey){ | ||||||
|  |                     e.preventDefault() | ||||||
|  |                     this.dispatchEvent(new CustomEvent("submit", { detail: e.target.value, bubbles: true })) | ||||||
|                 e.target.value = '' |                 e.target.value = '' | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
|         }) |         }) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user