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 }))
|
||||
console.error(e.target.value)
|
||||
})
|
||||
this.textBox.addEventListener('keyup', (e) => {
|
||||
e.preventDefault()
|
||||
if (e.key == 'Enter' && !e.shiftKey) {
|
||||
this.dispatchEvent(new CustomEvent("submit", { detail: e.target.value, bubbles: true }))
|
||||
this.textBox.addEventListener('keydown', (e) => {
|
||||
|
||||
if (e.key == 'Enter') {
|
||||
if(!e.shiftKey){
|
||||
e.preventDefault()
|
||||
this.dispatchEvent(new CustomEvent("submit", { detail: e.target.value, bubbles: true }))
|
||||
e.target.value = ''
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user