feat: dispatch upload event and refocus input field after file upload completes

This commit is contained in:
2025-05-07 22:31:21 +00:00
parent 256f741633
commit 2a1b8059d2
2 changed files with 6 additions and 2 deletions
+2
View File
@@ -49,6 +49,8 @@ class UploadButtonElement extends HTMLElement {
}; };
request.send(formData); request.send(formData);
const uploadEvent = new Event('upload',{});
this.dispatchEvent(uploadEvent);
} }
channelUid = null channelUid = null
connectedCallback() { connectedCallback() {
+3 -1
View File
@@ -42,7 +42,9 @@
} }
} }
}); });
document.querySelector("upload-button").addEventListener("upload",function(e){
getInputField().focus();
})
textBox.addEventListener("paste", async (e) => { textBox.addEventListener("paste", async (e) => {
try { try {
const clipboardItems = await navigator.clipboard.read(); const clipboardItems = await navigator.clipboard.read();