Focus while upload.

This commit is contained in:
retoor 2025-05-08 00:31:21 +02:00
parent b0666a0090
commit 707788583a
2 changed files with 6 additions and 2 deletions
src/snek

View File

@ -49,6 +49,8 @@ class UploadButtonElement extends HTMLElement {
};
request.send(formData);
const uploadEvent = new Event('upload',{});
this.dispatchEvent(uploadEvent);
}
channelUid = null
connectedCallback() {

View File

@ -30,7 +30,7 @@
function getInputField(){
return document.querySelector("textarea")
}
function initInputField(textBox) {
textBox.addEventListener('keydown', (e) => {
if (e.key === 'Enter' && !e.shiftKey) {
@ -42,7 +42,9 @@
}
}
});
document.querySelector("upload-button").addEventListener("upload",function(e){
getInputField().focus();
})
textBox.addEventListener("paste", async (e) => {
try {
const clipboardItems = await navigator.clipboard.read();